1.

Solve : Password Protecting HTML?

Answer»

I am trying to password protect a HTML file, but I do not want the whole file that I am trying to protect encripted or the .htaccess way of doing it.
The first page should contain the password box and upon entering correct
password it would take or allow access to next page, I can put the password box in my HTML, but I do not know what to look for to MAKE it check password and directing it to next page ?

JohnHere is the easy way.Just protect a whole folder.
Prepare an entry page where you EXPLAIN that beyond that the next page requires a password. Then put a link and indicate that they can either click to enter or RETURN to the main page.

You might call the new folder _private and put a index.htm file in it. Your link will be _private/index.htm and the visitor will se a dialog box before the page will load.

Go to your WEB site administrator panel and you should find a place where you can create a new folder in the public_html and make it password protected. The web server shod do the rest.

Think about it. Protecting an entire folder is much better plan. That sway the visitor can not see anything in the folder without the password. Once inside that folder, the password is not required unless he drops out of that folder.
Well I wanted to see if it could be done just on one page. I come up with this code...
 
   Password:
   
   
   
...it works fine as far as moving to the next page, but does not check for password and I wanted to use a non encripted password. I guess what I need to know is what codes are involved after you enter your password and hit enter, like most languages use the if command then if true goes on and if false returns?

JohnAre you the only person who will be accessing the file? If so, do you have a static IP?I am the only user, but I have IP address that changes all the time.
I did find Javascript version that might work and comes with all the detail at:

http://allwebco-templates.com/support/S_password_protect_simple.htm



JohnThe javascript comes very close to what you want. It has low security.if your GOING to "password protect" a web page with javascript, you may as well not protect it at all.

it's easy to do this via PHP; even using $_GET parameters on the URL is better then a javascript solution. Or $_POST would be more secure.The OP has already indicated that he does to want to use server side methods, This makes it near impossible to use plain vanilla HTML to do a client side page protection. And he said he does not want encryption

But the OP does not seem to get it. Maybe this is some kind of homework assignment. The kind where the teacher wants to frustrate the youngster who thinks he knows it all.

N o maybe the OP  has been insulted and he is not coming back. But if he is still with us, here is a recombination. Please read of this link and let yus know if you grasp the ideas.

Secure Sockets Layer protocol.

http://www.webopedia.com/TERM/S/SSL.html
Quote

The OP has already indicated that he does to want to use server side methods
No, he never did. He said the "htaccess" way of doing things. nothing about not using PHP or any other server-side method. Quote
No, he never did. He said the "htaccess" way of doing things. nothing about not using PHP or any other server-side method.

Sorry, I did not understand. Yes, PHP would be the way to go.



Discussion

No Comment Found