I need to password protect a page on my site

liunx

Guest
I did a search for passwords, but didn't find anything that was specific to me, or that I could fully understand.<br />
<br />
I would like to have a page on my html website for family members only. I was thinking the best way to do this would be to have a password protected page.<br />
<br />
How can I go about password protecting a single page? It would be really nice to have a code that will allow me to place a link, and upon clicking that link, a password box opens. Then if you place the correct password in, the web page loads.<br />
<br />
Any ideas guys? Thanks.<!--content-->Server-side would of course be the preferred method to handle this, however, that may not available; in that case, you could use JavaScript (<!-- m --><a class="postlink" href="http://www.webdevfaqs.com/javascript.php#protect">http://www.webdevfaqs.com/javascript.php#protect</a><!-- m -->).<!--content-->If you were to search javascript.internet.com, you would probably, in its easiest way, this script:var user = document.forms[0].elements[0].value<br />
var passwd = document.forms[0].elements[1].value<br />
<br />
var theUser = "user"<br />
var thePass = "pass"<br />
<br />
if(user == theUser && passwd == thePass) {<br />
window.location = "success.html"<br />
}<br />
else {<br />
alert("Password is wrong.")<br />
window.location = "bad.html"<br />
}DO NOT USE THE ABOVE SCRIPT!! (unless it is a low security password protection that you wouldn't mind some people who had no clue what they were doing looking at their code and found the success web site and decided to go there).<br />
<br />
If you wanted a safer way of doing it, refer to the above post and use server side<br />
<br />
EDIT: If you want to use javascript, many of us at that forum, including myself, can help you out by making an encryption way of doing. Just ask at that forum! (I have a secure password script on my site that runs on characters and numbers and rarely letters, however, these passwords can be nearly impossibly unencrypted.)<!--content-->Originally posted by steelersfan88 <br />
refer to the above post and use server sideOr client-side (i.e., JavaScript). ;)<!--content-->http://quasi-ke.servebeer.com/article.doc it will be officially published on wendsday. How to make logins using asp.net. This would be the server side method.<!--content-->
 
Back
Top