How do I restrict access to my website - require a password etc.?

L

Liquor Dealer

I need to be able to limit access to my site by requiring a password or
membership. How do I make it accessable only to those who have permission?
 
T

Tom Pepper Willett

Password Protect Part of a Web:
http://support.microsoft.com/default.aspx?scid=kb;en-us;301554
--
===
Tom "Pepper" Willett
Microsoft MVP - FrontPage
---
About FrontPage 2003:
http://office.microsoft.com/home/office.aspx?assetid=FX01085802
FrontPage 2003 Product Information:
http://www.microsoft.com/office/frontpage/prodinfo/default.mspx
Understanding FrontPage:
http://msdn.microsoft.com/office/understanding/frontpage/
===
|I need to be able to limit access to my site by requiring a password or
| membership. How do I make it accessable only to those who have
permission?
 
M

Marcello do Guzman

Try Websie Login. Here's the link

http://www.websitelogin.com/

I've never used the service myself, because my hosting company does
not support this software.


Marcello



On Thu, 17 Feb 2005 17:15:06 -0800, "Liquor Dealer" <Liquor
 
T

Trym Bagger

Your security should be based on a combination of checking against a list of
users in a table, and then a Session variable, which is checked on all the
pages you want to protect. You could do something along the lines of this:

Login.asp:

<%
Dim UserName
Dim Password
UserName = Request.Form("Username")
Password = Request.Form("Password")
If Len(UserName) > 0 Then
msql = ("SELECT Username, Pw FROM users WHERE Usuario='" & UserName & "'
AND Pw='" & Password & "'")
Set RS = Conn.Execute(msql)
If RS.EOF Then
ErrorMessage = "<P><font color=""red"">Usuario o contraseña
incorrecto</font></P>"
RS.Close
Conn.Close
Set RS = Nothing
Set Conn = Nothing
Else
RS.Close
Conn.Close
Set RS = Nothing
Set Conn = Nothing
Session("SecurityID") = "askljhsdfvljhdsfgkjlh3tkljasdlkskuh"
Response.redirect "yourpage.asp"
End If
End If
%>
<Form Method="Post" Action="login.asp">
User name: <Input Name="Username" size="15"><br>
Password: <Input Type="Password" Name="Password" size="15"><br>
<Input Type="submit" Value="Enter" Name="Login">
</Form>

(If you wan't more security, you should another function which generates
random Session variables for each user.)

On yourpage.asp (and any other page you want to protect, you should add the
following code at the top:

<%
If Session("SecurityID") <> "askljhsdfvljhdsfgkjlh3tkljasdlkskuh" Then
Response.Redirect "editweb.asp"
End If
%>

If you want any further assistance do not hestitate to contact me.

Cheers,

Trym Bagger
www.lacanela.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top