PDA

View Full Version : Log in Page



Lee
10-11-2004, 01:01 PM
I've been messing with this code... And I need 2 changes and I don't know how to do them..
1. I need a USER name and a PASSWORD.. they don't have to match meaning they just need to enter one.
2. When the user puts in his USER name, it redirects them to there page. For an example. If Bob logs in with BOB, then he gets BOB.HTM or BOB.CSV page open... But if Sally logs in then she gets SALLY.HTM or SALLY.CSV (where ever I point her or him)

CODE:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function password() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password','');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1 == "password","chip") {
alert('You Got it Right!');
window.open('secure.htm');
break;
}
testV+=1;
var pass1 =
prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
}
if (pass1!="password" & testV ==3)
history.go(-1);
return " ";
}
// End -->
</SCRIPT>

</head>

<body>

<CENTER>
<FORM>
<input type="button" value="Enter Password Protected Area" onClick="password()">
</FORM>
<br>
<br>

</CENTER>

</body>
</html>