Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Codewalkers.com:
Writing a Basic Auth System
Dec 27, 2004 @ 13:53:14

Codewalkers.com has a new tutorial posted today for all of you out there looking to make an authentication system with PHP.

Occasionally a site administrator will want to make certain material available online, but also have it accessible to only a select few. Some examples of this might be student records, personalized information, email and even personal photo albums.

Of course there are many ways to restrict access to information ranging from web server configurations to third party programs. In this tutorial, we'll take a look at the basic theory behind a user authentication system using PHP.

They use the sha1 function to encrypt the passwords (another possible option is the md5 function), and stores them in a database. Then, they show you how to create the form and link it to the database for user authentication. They set a flag in the session that's started to ensure that a user is still logged in and is allowed to access a certain resource.

tagged:

Link:


Trending Topics: