
I’ve been asked this continuously. The quick response people get is: there is no way to accurately protect your site without the use of server side scripting.
But actually there is one way to password protect a page using only HTML (and a little client side scripting). It is a dirty little trick but serves the purpose of genuine security without using any server side scripting at all.
Rename the page you want to protect to be the password, for example: mypassword.htm.
Now, in the entry page, have an input box for the password and a javascript that navigates the browser to whatever is typed in the input box plus the htm extension (“.htm”).
So, when your visitor types “mypassword” in the box, your script loads “mypassword.htm” and the visitor is in. If any other word is typed in as a password the request will return a 404 error (page not found).
This would definitely not be my main approach to password protection, but if you are only looking to quickly protect a page without complicating yourself with finding a PHP host, it will do the trick just fine.


Do you have something to say?
Then say it! NetBulge.com is devoted to web development. We are always looking for fresh and relevant ideas. If you are a web designer with a voice, this is the place to make it heard.
Join us! Need I say anything? - The best browser out there, period. A well designed efficient interface is only the beginning here; web safety and a truck load of good extensions are the turning point. If you haven’t tried it yet, you are seriously missing out.
Web design, web development, technical communication, and IT made simple for both professionals and non-geeks.
http://www.christopherjason.com