What you want to do (and much more) is thoroughly described in this excellent book from SitePoint.
http://www.sitepoint.com/b
If you are interested in rapid prototyping, you might want to check out Ruby on Rails, where all of this client registration and login stuff is already built into the machine. Or use one of the popular PHP systems like Joomla and Drupal.
Although you CAN do it, I would not recommend starting up a project by writing a registration and login system. There is so much already written about that, and so many ways to do it wrong, that your value-added portion is almost certain to come from somewhere else in the application design.
best regards, ~Ray
Main Topics
Browse All Topics





by: adrian_brooksPosted on 2009-07-04 at 11:10:48ID: 24777550
Actually, what you are wishing to accomplish is a rather common task. Many websites use access control methods to only allow registered members to obtain the ability to view information.
to check if a member is logged in and if not, then they would be redirected back to the login page and thus denied access to the member's only content. :)
If you're new to PHP & MySQL, I would recommend that you become familiarized with both by doing google searches for PHP tutorials as well as MySQL tutorials. On the other hand, if you have some basic skills with them, then it's just a matter of creating a users or members table in your database that will store usernames, encrypted (preferrably MD5) passwords and basic member account information.
Present them with a login form and if their login id and password matches, then set a session variable that can be used to allow only that signed in member the ability to see other pages that would otherwise be restricted from viewing.
Each page that you wish to embed behind an authentication system would just use a simple if($_SESSION['logged_in'])
Hope this was a base for you to model you site from.
~A~