joz
04-07-2008, 09:41 PM
Im creating a website for a comp sci class, and I thought I would have a bit of fun with "42" yadda yadda
What I need is either a java or html box were the correct imput is 42 to go to a "secret page"
<form action="hidp.html"
method="get">
Answer to the universe?
<input type="password" name="password" value="" size="8" maxlength="2">
<input type="submit" value="Submit" />
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkPw(form) {
pw1 = form.pw1.value;
if (pw1 != 42) {
alert ("\nYou did not enter the correct password")
return false;
}
else return true;
}
// End -->
</script>
<form onSubmit="return checkPw(this)">
<center>
<table border=0>
<tr>
<td>Password:</td><td><input type=text name=pw1 size=10></td>
</tr>
<td colspan=2 align=center><input type=submit value="Submit!"></td>
</tr>
</table>
</form>
the first one accepts any two letter combos, and the second one I cant figure out how to link to the page I want it to go to (hidp.html)
And I realy, realy suck at coding **** beyond simple things like bg color and centering...yea.
------\
in a nut shell
enter correct password "42"
goes to hidp.html
What I need is either a java or html box were the correct imput is 42 to go to a "secret page"
<form action="hidp.html"
method="get">
Answer to the universe?
<input type="password" name="password" value="" size="8" maxlength="2">
<input type="submit" value="Submit" />
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkPw(form) {
pw1 = form.pw1.value;
if (pw1 != 42) {
alert ("\nYou did not enter the correct password")
return false;
}
else return true;
}
// End -->
</script>
<form onSubmit="return checkPw(this)">
<center>
<table border=0>
<tr>
<td>Password:</td><td><input type=text name=pw1 size=10></td>
</tr>
<td colspan=2 align=center><input type=submit value="Submit!"></td>
</tr>
</table>
</form>
the first one accepts any two letter combos, and the second one I cant figure out how to link to the page I want it to go to (hidp.html)
And I realy, realy suck at coding **** beyond simple things like bg color and centering...yea.
------\
in a nut shell
enter correct password "42"
goes to hidp.html