Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I hope I'm not asking a question for which the answer is obvious...If I am, apologies.

Within my html site (i.e. not Wordpress, Joomla, etc.) I want to be able to have a level of user management. That means that some pages I want to be only accessible to certain people with the correct username and password.

What's the best way to do this?

Are there any available scripts out there? I guess I'm looking for a free/open source version of something like this: http://www.webassist.com/php-scripts-and-solutions/user-registration/

share|improve this question
Is there a special reason you're not using a CMS and just leveraging the user management that's basically given to you as part of that? Honestly, my immediate response to being asked for the "best" way to do this is "put it in a CMS." – Su' May 14 '11 at 1:00
Not particular, but just that I didn't need one for the actual content as it's all hand coded. – James Buldon May 14 '11 at 10:54
Have you got any suggestions of a lightweight CMS that will basically just handle the users? – James Buldon May 14 '11 at 10:54

You have two options (assuming you will not be using server side scripting whish is implied in your question):

1) Use JavaScript - this allows you to dynamically check a username and password, set cookies, and reject users who fail authenticate. The downside to this is anyone who knows how JavaScript works can easily find the username and password in your JavaScript and gain access to your site. Or, even easier, just turn off JavaScript to bypass it completely.

2) Use Basic Authentication - This allows you to have a little pop up window that asks for a username and password and if the login fails reject the user. The downside to this is you'll need to set up each user through a control panel or through SSH.

share|improve this answer
More downsides: 1> Depending upon some particulars of implementation, the Javascript method could circumvented altogether by just disabling JS in the browser. 2> You said you wanted to protect some pages. Basic Auth is quick and easy for blocking entire sites or directories, but is going to become a huge pain if you need to do a lot of picking and choosing. – Su' May 14 '11 at 1:02
Don't ever suggest JavaScript authentication, some people might mistakenly think it's secure. @Su' He could simply move all his private files to subdirectory. – kba Nov 10 '11 at 21:23
Plus, Basic http authentification is only secure if server over https. – Zenklys Jan 9 '12 at 23:56

How about Adobe Contribute? It's a program with a WYSISWYG interface. It's not free, it costs $99 per license, which makes it excellent for corporate use. However, if that's too much for you, Adobe has a new program called Subscriptions to use their software on a month-to-month basis.

Or, you may want to look into a super tiny CMS system, such as LittleCMS. If this one doesn't suit your fancy, there are a lot out there, they are pretty easy to find.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.