i just want to create a password in my javascript webpage, and after the user inputted the right password he will be directed to other wegpage that i created.
alert ("hi challenger! please press ok and tell me youre name");
var a = prompt("so your name is? ", " to be honest! I FORGOT!")
alert ("ahh, ok! so youre name is " + a);
document.write("if you want to challenge yourself then you've come to the right place!<br>first! i would like you to find the password to gain access to level 2");
</script>
<script language="text/JavaScript">
{
var a="null";
function check()
{
if (document.a.c.value == a)
{
document.location.href="cary1.html/"+document.a.c.value+".htm";
}
else
{
alert ("Try again");
}
}
}
</script>
oops! i forgot to say, i want to write the password in the page source so that it can be view by the users, what i want to create are a maze-like webpage where you will need to find the password.
what i want to create are a maze-like webpage where you will need to find the password.
No way. At least not 100% in a secure way. Javascript is a client-side language, thus the code is to be seen by the user, a way or another. Easily enough for an average coder to decipher whichever you might have ciphered.
JavaScript was not invented for this kind of job. Use a server-side solution for that.
Bookmarks