Password Sign In

[Total: 0    Average: 0/5]

This script will open a secret document if the user types in the right username and password.

Head Code:

<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
var _secret_document = "/"; /* This would be the secret page */
function checkLogin()
{if (document.login.username.value=="Patrick" & document.login.password.value=="javascript")
window.location=_secret_document;
else alert ("Access Denied")}
// -->
</SCRIPT>

Body Code:

This is the cheating part so you can know what the username and password are.
<BR>Remove this text when you use it.
<BR>Username: Patrick
<BR>Password: javascript
<FORM NAME="login">
USERNAME: <INPUT TYPE="TEXT" NAME="username"><BR>
PASSWORD: <INPUT TYPE="PASSWORD" NAME="password"><P>
<INPUT TYPE="BUTTON" VALUE="Login" ONCLICK="checkLogin()">
</FORM>

Times Viewed: 8

Leave a Reply

Your email address will not be published. Required fields are marked *