PDA

View Full Version : Password script


Loser
05-25-2004, 01:54 PM
I didn't know if should put this in the javascript section of this section...but I guess I'm putting it here. I found this code off of this web site (http://javascript.about.com/library/scripts/blpassword.htm)
Can Someone take a look at it, I don't know how to install it and change the password. This is my code I have for my login page

function PasswordLogin()
{
document.location.href = document.formlogin.password.value + "blpasstest.html";
return false;
}

function CheckEnter(event)
{
var NS4 = (document.layers) ? true : false;
var code = 0;

if (NS4)
code = event.which;
else
code = event.keyCode;
if (code==13)
{
PasswordLogin();
event.returnValue = false;
}
}

</script>
<title>The Runescapers-Members Login</title>
</head>
<body style="background:url(options.jpg) center center no-repeat black;" bgcolor="black" text="gold">

<form name="formlogin" onsubmit="PasswordLogin()">
Password: <input type="password" name="password" size="20" onKeyPress="CheckEnter(event)">
<input type="button" value="Login" onclick="PasswordLogin()"></p>
</form>

</body>
</html>

agent002
05-25-2004, 02:21 PM
hi Loser,
it belongs to the client side scripting (JavaScript) section. :)
You should copy the script exactly as it is and keep it unmodified. Create a page with the name your password.htm, the script will just add .htm to the typed password and attempt to open the page - if the password's wrong, you get a 404 error.

Loser
05-25-2004, 02:29 PM
its not working....

agent002
05-25-2004, 02:35 PM
well, try this one then (I don't understand why they use a CheckEnter() function anyway). You should put it between the <head> and </head> tags of the login page.
<script type="text/javascript">
function submitLoginForm(pwd){
location.href = 'login-'+pwd+'.html';
}
</script>
You don't need to change anything in that script. This is the code for the form:
<form action="about:blank" method="post" onsubmit="submitLoginForm(this.password.value); return false;">
Password: <input type="password" name="password"><br>
<input type="submit" value="Log in">
</form>
No changes needed there either. Those both codes go to the login page, let's say login.html. What you need to do now is to create a new page called password-[your password].html; if the password you want is kiwifruit, make the filename password-kiwifruit.html. There is the secret area where you get after logging in; put anything you like there. If you type a wrong password, you get a 404 error.

Loser
05-25-2004, 02:37 PM
YAY, i got it working now....

Loser
05-25-2004, 02:42 PM
thanks you