Password a File/Directory #1:
Code:
logon.asp
verifyLogon.asp
authenticate.asp
default.asp
logon.asp
Highlight
Login Required
<% If Request("BadPass") = "True" then Response.write("
Invalid Password! Try Again...
") End If %>
A login is required to access the page you asked for
" METHOD="POST"> UserName:
Pass Code:
verifyLogon.asp
Highlight
<%@ LANGUAGE="VBSCRIPT" %> <% Response.Buffer = True %>
Verify Logon
<% UName = Request.Form("txtName") PCode = Request.Form("txtPassCode") ' The following select statement is the "hard coded option for validating passwords". You could ' Also insert ADO database code here to validate from a database. select case Ucase(Uname) case "ADMIN" If Ucase(PCode) = "1234" Then Session("Authenticated") = -1 Else Session("Authenticated") = 0 End If case "CARTER" If Ucase(PCode) = "~!" Then Session("Authenticated") = -1 Else Session("Authenticated") = 0 End If case else end select If Session("Authenticated") Then If Len(Request("url")) > 0 Then Response.redirect Request("url") Else Response.Write "Unable to determine which page to redirect to. Please use your back button and try again." End If Else Response.redirect "logon.asp?BadPass=True&url=" & Request("url") End If %>
authenticate.asp
Highlight
<% If Not Session("Authenticated") Then Response.Redirect "logon.asp?url=" & Request.ServerVariables("SCRIPT_NAME") End If %>
default.asp
Highlight
Administrators Menu
Client Name
Property Listing Maintenance
Add a New Property Listing
Update an Existing Listing
Agent Roster Maintenance
Add a New Agent
Update an Existing Agent
Site Reports
View Web Statistics - Updated Daily!
How-To-Read Web Statistic Reports
Instructions
Photo Scanning Instructions
Return to Home Page