Password Verification

Please enter the password (see code below):

 

This form posts the data to this same page where it is checked by a VB script which redirects you to a different page if you enter the correct password. The script can't check the password without resending the page since the script is only run when the page is being built - the script runs on the server and is not sent to the client so the checking of the password cannot happen on the client computer.

You might be wondering whether it would be better to check the password with a client-side script i.e. a script that is delivered with the web page and runs on the client computer. This would be a bad idea since anyone could view the source code for the page and would be able to see the password in the script.

Here's the code, including the HTML code that builds the form and its contents:

<%
if request.form("passwordattempt")="dog" then
	Response.redirect "passwordsuccess.asp"
end if
%>
<form method="POST" action="password.asp">
Please enter the password:<input type="text" name="passwordattempt" size="20">
<input type="submit" value="Submit" name="B1"></p>
</form>