Web Development

General discussion


Passwords in HTML

By laurie ·
I have a web site written in HTML and I want to provide access to one web page only by the entry of a password (for my clients). Ideally I would like each client to decide their own (username &amp password, but if that is too difficult, then I would be happy to provide each client with the same necessary password.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by Toivo Talikka In reply to Passwords in HTML

You need to add a bit of interactivity to your web page by way of javascript (absolute minimum but not safe) or preferably by adding support for server side scripting.

If your web server platform is Linux and you have PHP available, there are a number of tutorials on the web and free snippets of code available from PHP developer forums how to authenticate users.

If you go for javascript and one password, you may want to set up a hidden field and compare the user input and the contents of the hidden field before the user can proceed to the next page.

Collapse -

by mikewindschitl In reply to Passwords in HTML

A very simple way of accomplishing a single password for everyone is to put the pages you want private in a separate folder with one page labeled index.htm or whatever the default page is named. Then distribute the folder name to the users who need access to the pages. An example http://northwindconsulting.com/ if you type cmhpp after the URL you will find a hidden page, http://northwindconsulting.com/cmhpp/. Make sure to add a robots.txt file to you main directory to disallow the folder you created or the search engines may pick up the pages in time. It is also easy to change the folder name at any time if the URL becomes too well known. All the users need to know is the main site to go to and the folder name becomes the password.

Collapse -

by michael.crocker In reply to Passwords in HTML

You also need to think about crackers hacking into your website. Javascript on the page and hidden forms are not safe. I would start with emailing them a unique password and let them change it when they login. If your webserver supports it, make it an ssl connection. You will also need to think about how you are going to store any information you collect about the user. Even just getting a copy of a list of valid emails is of value to some.

Collapse -

by prepostra In reply to Passwords in HTML

Here is a more detailed tutorial for Answer 2.

I have used this on sites where .htaccess or MySQL wasn't available and had good results with it.

Related Discussions

Related Forums