...

View Full Version : How can i make two diffrend login and password



DraftRacer
03-02-2003, 10:58 AM
I cant make two diffrend Login and password I need 5 or 3 bat it only login to one of them and i dont know how to let it login to 3diffrend passwords and logins :confused: plz mail me or something :thumbsup:

claudiuiacob
03-02-2003, 02:19 PM
FIRST, I wouldn't use JS for password & login stuff (anyone clever enough to go to "View - > Source" will see the passwords), but anyway...

Suppose you have this script:



<html>
<head>


<script language="JavaScript">
<!--

var passes = new Array();
var done = false;

//passwords below;

passes[0] = 'white';
passes[1] = 'blue';
passes[2] = 'red';
passes[3] = 'green';
passes[4] = 'black';

//got it? you can add as many passwords as you like; for now
//you have 5.

function logMEin()
{
if (done)
{
for (i=0; i<passes.length; i++)
{
if (document.login.login_field.value == passes[i])
{
window.location = "index.html";
break;
}
else
{
if (i == (passes.length-1))
{
alert('The password you typed is wrong!\nTry again!')
document.login.login_field.select();
}
}
}
}
}

//-->
</script>

</head>

<body onload="done=true">

<form name="login">
<center>
<input name="login_field" type="text" size="30" maxlength="25" value="">
<br>
<input name="go" type="button" value="login" onclick="logMEin()">
<p>
If you have a password, enter it in the field above and press
the <b>login</b> button; <br>
</p>
<!-- by the way, that's for dummies -->
</center>
</form>

</body>

</html>


For your amusement, put a file called "index.html" in the same folder. Just to see that it works. Again, I SEE NO WAY to actually
use this without PHP, ASP or something.

JS login is just dust in the eyes, as a romanian expression says.

Borgtex
03-02-2003, 03:41 PM
http://www.codingforums.com/showthread.php?s=&threadid=10114



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum