|
CodeAve.com - ASP - Miscellaneous | |||
|
|
||||
| Password Protection (Hardcoded Value) | ||||
|
|
||||
<% u_password=request.form("u_password") ' Checks the value of the password being submitted ' If the password is correct then the restrict access content will display select case u_password case "codeave" %> Restricted content to be displayed to properly registered users only <% case else ' Checks to see if the user has submitted a password or if one was submitted ' If there is no value in u_password field or if it is anything ' other than codeave then the input form will display ' prompting the user to input the appropriate information if (u_password <> "codeave" and u_password <> "") then ' If the password submitted in not null then display a message ' informing the user that an incorrect password was supplied response.write "The password you have entered is incorrect" end if if (u_password <> "codeave" and u_password = "") then ' If the password submitted is not null then display a message ' informing the user to enter a password response.write "Please Sign-In" end if %> <form action="<%= request.servervariables("script_name") %>" method="POST"> User Name:<br><input type="text" name="u_name" length="20" maxlength="10"><br> Password:<br><input type="password" name="u_password" length="20" maxlength="10"> <input type="Submit" value="Submit"> </form> <% end select %>
|
||||
|
|
||||