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/

  • 1
    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'
    Commented May 14, 2011 at 1:00
  • Not particular, but just that I didn't need one for the actual content as it's all hand coded. Commented May 14, 2011 at 10:54
  • 1
    Have you got any suggestions of a lightweight CMS that will basically just handle the users? Commented May 14, 2011 at 10:54

2 Answers 2


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.

  • 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'
    Commented May 14, 2011 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
    Commented Nov 10, 2011 at 21:23
  • Plus, Basic http authentification is only secure if server over https.
    – iammichiel
    Commented Jan 9, 2012 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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