I was planning to put a small password protected page on my website that only my freinds would be able to access.
I was going to use this piece of code:
<HEAD><script language="JavaScript"><!--hidevar password;var pass1="PASSWORD GOES HERE";password=prompt('TEXT ON P-UP',' ');if (password==pass1)alert('TEXT IF CORRECT');else { window.location="URL OF PAGE THAT IT GOES TO IF THEY ANSWERED WRONG"; }//--></SCRIPT></HEAD>
I cannot get this to work unfortunatly, the page displays without asking for any password, can anyone see a way of getting it to work or provide an alternate with a similair function?
Question
Neb
I was planning to put a small password protected page on my website that only my freinds would be able to access.
I was going to use this piece of code:
<HEAD><script language="JavaScript"><!--hidevar password;var pass1="PASSWORD GOES HERE";password=prompt('TEXT ON P-UP',' ');if (password==pass1)alert('TEXT IF CORRECT');else { window.location="URL OF PAGE THAT IT GOES TO IF THEY ANSWERED WRONG"; }//--></SCRIPT></HEAD>I cannot get this to work unfortunatly, the page displays without asking for any password, can anyone see a way of getting it to work or provide an alternate with a similair function?
Link to comment
Share on other sites
5 answers to this question
Recommended Posts