• 0

Password for web page


Question

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

  • 0

this wouldn't do much, since anyone can look at the source code of the page and find the password anyway. i would suggest using asp or php to do this; then people can't see the password since the source code of asp and php is never sent to the client.

Link to comment
Share on other sites

  • 0

it doesnt bother me that people could see that password, the people who are smart enought to do that wont be interested by what they find, the problem is that i cant get that code to work on my site here: http://www20.brinkster.com/nebsplace/secret.html .

.htaccess, after a quick google search, seems fairly complicated (to me anyway), yet seems a very professional solution.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.