|
-
Dec 21st, 2008, 11:00 AM
#1
Thread Starter
Frenzied Member
[JavaScript] TextBox, keydown, other page..
Hello on my website i have a textbox on the first page. I want it so the users enter a specific password in the textbox, click the enter key on their keyboard and/or a button on the screen and then if the password for example eqauls "12345" then the user will advance to "http://www.mywebsite.com/secretpage.html".
Also since the above website is suppose to be a 'secretpage' i dont want the user able to just type that link on the addressbar and bypass my password. What can i do about this?
-
Dec 21st, 2008, 04:04 PM
#2
Thread Starter
Frenzied Member
Re: [JavaScript] TextBox, keydown, other page..
I don't need it so much encrypted etc.. so i am using this code:
Code:
<script language="javascript">
var pswrd = "321369"
var confirmation = prompt("Please enter the password below! If you enter an incorrect password you will be transfered to the homepage!")
if (confirmation==pswrd) {
alert("Password correct! You may continue.")
}
else
{
alert("Password invalid! You will now be transfered to the homepage!")
window.location = "\Index.html"
}
</script>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|