So I'm trying to create a password protect webpage in java script, This is what I got:
tdproject.html:
<html>
<head>
<script>
<!--- Hide from old browsers
function submitPass() {
var location;
var password;
password=this.document.login.password.value;
location=password + ".html";
location.href = location;
}
--->
</script>
</head>
<body>
<form name="login">
<INPUT TYPE="password" NAME="password" VALUE="" size="20">
<INPUT TYPE="button" NAME="button" Value="Submit Password" onClick="submitPassword(this.form)">
</form>
</html>
and in the same folder I have chaching.htm (so 'chaching' being my password)
So this kinda works...
I got to the html and put in the password (chaching) then hit submit.
it then takes me here:
http://mikeverret.webs.com/tdgame/tdproject.htm?password=chachingand then thats it.
I tried putting this in the chaching.htm file;
<META HTTP-EQUIV="Refresh" content= "0;URL=http://www.blahblahblah.ca">
but that did not work.
If you don't know what I mean then try it:
http://mikeverret.webs.com/tdgame/tdproject.htmpassword is 'chaching'
(password is a random thought up word)
Sos yes I want it to redirect to a page if the password is incorrect, and to another page if the password is correct.
I noticed this up top:
location.href = location;
instead of location, would I put another address?
edit : great now its not working ARGH!