littlehank
04-30-2006, 06:47 PM
I am new to javascript, and I am trying to make a password page that redirects you if the password is correct. This is what I have in the password page, called login.html:
<head>
<script src="pwrd.js"></script>
<script language=javascript>
function login(x) {
if(x==pwrd) {
window.location = redir;
} else {
window.location = "wrongpass.html";
}
}
</script>
</head><body bgcolor=000000>
<form method=post onsubmit=login(pass)>
<font face="Courier New" size=3 color=#00ff00>Password: <input type="password" name="pass">
<input type=submit value="Submit">
</form>
</body>
and I have this in pwrd.js:
var pwrd=lala;
if(new_loc==forum) {
var redir=mboard/index.html;
}
The link to login.html looks like this: <a href="login.html?new_loc=forum">
I cannot figure out what I am doing wrong. It's probably something really simple. Please point out what the problem is.
<head>
<script src="pwrd.js"></script>
<script language=javascript>
function login(x) {
if(x==pwrd) {
window.location = redir;
} else {
window.location = "wrongpass.html";
}
}
</script>
</head><body bgcolor=000000>
<form method=post onsubmit=login(pass)>
<font face="Courier New" size=3 color=#00ff00>Password: <input type="password" name="pass">
<input type=submit value="Submit">
</form>
</body>
and I have this in pwrd.js:
var pwrd=lala;
if(new_loc==forum) {
var redir=mboard/index.html;
}
The link to login.html looks like this: <a href="login.html?new_loc=forum">
I cannot figure out what I am doing wrong. It's probably something really simple. Please point out what the problem is.