NOTE: If you want the final script instead of copy / paste just download the attatchment and change the file extension from .txt to .jsFirst change the u1, u2, etc to the usernames that you wish. Do the same for the p1, p2, etc. NOTE:there is NO limit on the usernames & passwords. Next change the yourpage.html to whatever page you want.
CODE
<!-- Begin
function Login(form)
{
username = new Array("u1","u2","u3","u4","u5","u6","u7","u8","u9","u10");
password = new Array("p1","p2","p3","p4","p5","p6","p7","p8","p9","p10");
page = "yourpage" + ".html";
if (form.username.value == username[0] && form.password.value == password[0] || form.username.value == username[1] && form.password.value == password[1] || form.username.value == username[2] && form.password.value == password[2] || form.username.value == username[3] && form.password.value == password[3] || form.username.value == username[4] && form.password.value == password[4] || form.username.value == username[5] && form.password.value == password[5] || form.username.value == username[6] && form.password.value == password[6] || form.username.value == username[7] && form.password.value == password[7] || form.username.value == username[8] && form.password.value == password[8] || form.username.value == username[9] && form.password.value == password[9])
{
window.self.location.href = page;
return true;
}
else
{
alert("Either the username or password you entered is incorrect.\nPlease try again.");
form.username.focus();
}
return true;
}
// End -->
to use this script on a html page insert this right before the form tag
CODE
<script language="JavaScript" type="text/JavaScript" src="login.js"></script>
Tell me what you think by rating / comments.