PDA

View Full Version : PHP Login Script


llbbl
12-08-2004, 06:12 AM
This is the best one that I have found.

Introduction

I wrote the popular evolt.org tutorial PHP Login Script with Remember Me Feature mainly as an introduction to user sessions and cookies in PHP. Since it was created as a learning tool, many advanced features were left out of the script. By popular demand, I have written and am presenting here a complete Login System, with all the features that were left out of the first script, that can be easily integrated into any website.
Notes

This article is intended primarily for intermediate to advanced users of PHP, as it is not exactly a tutorial, but a description of the implementation of an advanced Login System. Beginners who are looking to learn about user session and cookies in PHP are advised to read the above mentioned tutorial before reading this article.
Features

Here are some of the features in this Login System that weren't included in the initial tutorial:

* Better Security - Passwords are not stored in cookies, randomly generated ids take their place.
* Member Levels - Now users can be differentiated by what level they are (user, admin, etc.)
* Admin Center - As an admin, you have full control over registered users. You can view user info, upgrade/demote user levels, delete users, delete inactive users, and ban users.
* Visitor Tracking - You can now tell how many guests and users are actively viewing your site, and who those users are. You also know how many total members your site has.
* Account Info - Users can now view their own information, and edit it as well. They can also see the information of other users.
* Form Helper - No more ugly error pages! Now users are redirected to the form they filled out and the errors that have occurred are displayed.
* Forgot Password - Users who forget their password can have a new one generated for them and sent to their email address.
* Email - Now emails can be sent to newly registered users.
* Miscellaneous - Much better code design, smooth page transitions, and MORE!


http://www.evolt.org/article/PHP_Login_System_with_Admin_Features/17/60384/index.html

Here you can download the script below. I had to change it to a rar inorder to make it past our filters :D

llbbl
12-08-2004, 06:13 AM
Here is some useful comments I found in that article.

Hope this helps
leblanc wrote on 10/25/2004 at 11:57 PM
I think you might want to look at this for categorizing users in groups http://phpgacl.sourceforge.net/ I've learned quite a bit from this tutorial.... Really good concept but take a look at sitepoint I like the sitepoint script becuase I don't have to recheck the database and can just check the hash key value that is md5 encoded. You can scale this code by encoding the ip address, adding an error field as done by jpmaster77 in his script, I'm actually going implement the bred of jpmaster and sitepoint on one of my sites.. already completed it just adding the ip address to be encoded in the hashkey... this way if session ID is stolen user will still not be authenticated.. xposure

http://www.sitepoint.com/article/anthology-2-1-access-control

openbsd-flipp
12-14-2004, 07:06 AM
Good stuff. Now if there was a plugin to create a flowchart off of the code it would save me alot of time at school/work

llbbl
12-14-2004, 07:16 AM
Uhh...

http://forums.designtechnica.com/showthread.php?t=6070

I think those will do it