PHP Classes

Login Controller: Manage registration and authentication of users

Recommend this page to a friend!
  Info   View files View files (15)   DownloadInstall with Composer Download .zip   Reputation   Support forum (8)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 62%Total: 5,690 This week: 1All time: 419 This week: 560Down
Version License PHP version Categories
logincontroller 1The PHP License5PHP 5, Databases, User Management
Description 

Author

This package can be used to manage registration and authentication of site users. Requires PHP 5 and MySQL

It can redirect the users to pages that present forms to let the users register and login a site.

It can also process the the forms and execute several types of actions that manage user records stored in a MySQL database, like: create new user records, validate user registration and login forms, reset user password, change the user password, etc..

Picture of Dave Hale
  Performance   Level  
Name: Dave Hale <contact>
Classes: 2 packages by
Country: United Kingdom
Age: 48
All time rank: 48326 in United Kingdom
Week rank: 411 Up12 in United Kingdom Up

Details

hi and thanks for looking at my class 1) First thing to do is copy the dictionary folder into your root directory<br/> the class looks for it here. protected $path_to_dictionary= '/dict/dict.dic';//path from \$_SERVER['document_root'] the class uses $_SERVER['document_root'].$path_to_dictionary so not doing this means either change the code or emailing new passwords will hang the script. 2) then goto the database.inc file and set up your connection there is two sets for my own use but i have left them in for any who can use. $host = "localhost"; //Database host. $user = "root"; //Database username. $pass = "password"; //Database password. $dbase = "mydatabase"; //Database. 3) now create a table in the database you named above with the following structure'; -- Table structure for table `members` -- CREATE TABLE IF NOT EXISTS `members` ( `memberID` int(10) unsigned NOT NULL AUTO_INCREMENT, `memberName` char(20) NOT NULL, `password` varchar(64) NOT NULL, `email` varchar(128) NOT NULL, PRIMARY KEY (`memberID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; <?php $loginController->display_bar(); $loginController->display_page(); echo $loginController->msg; echo '<br/>username = '.$loginController->get_username(); echo '<br />user ID ='.$loginController->get_userId(); ?> Now in your script you wish to include the login bar simply add a link to the css file included with this class. the html and css for the forms / bars etc is near 100% free from script files for easy modification of the display. include 'LoginTracker.inc'; BEFORE !!! any session_start() calls and then when you want the bar to display add the following line to your script. $loginController->display_bar(); in order to display any forms associated with the class you need to display them. $loginController->display_page (); This will return true if the user has pressed / entered info or false if no action is required by the class. so you can simply use if( !$loginController->display_page ()){ <i>do something else</i> } or $loginController->display_page (); and let your script carry on regardless of if the user has asked for say registration. The registration form will be rendered followed by anything else in your script.

  Files folder image Files  
File Role Description
Files folder imageclasses (1 directory)
Files folder imagecss (1 file)
Files folder imagedict (1 file)
Files folder imagehtml (5 files)
Files folder imagelogs (2 files)
Files folder imagescripts (1 file)
Accessible without login Plain text file example.php Example example script
Accessible without login Plain text file index.php Example setup info and demo script
Plain text file LoginTracker.inc Class main class file
Accessible without login Plain text file readme.txt Doc. setup info

  Files folder image Files  /  classes  
File Role Description
Files folder imagedatabase (1 file)

  Files folder image Files  /  classes  /  database  
File Role Description
  Plain text file database.inc Class database class for extends

  Files folder image Files  /  css  
File Role Description
  Accessible without login Plain text file loginControl.css Data default css

  Files folder image Files  /  dict  
File Role Description
  Accessible without login Plain text file dict.dic Data onary password file

  Files folder image Files  /  html  
File Role Description
  Accessible without login Plain text file change_PasswordForm.inc Aux. html file
  Accessible without login Plain text file forgot_password_form.inc Aux. html file
  Accessible without login Plain text file loggedinpanel.inc Aux. html file
  Accessible without login Plain text file loginForm.inc Aux. html file
  Accessible without login Plain text file user_registrationForm.inc Aux. html inc file

  Files folder image Files  /  logs  
File Role Description
  Accessible without login Plain text file database.txt Data database access log
  Accessible without login Plain text file tracefile.txt Data class process tracking logfile

  Files folder image Files  /  scripts  
File Role Description
  Accessible without login Plain text file validate_fns.inc Aux. email verify ereg script

 Version Control Unique User Downloads Download Rankings  
 0%
Total:5,690
This week:1
All time:419
This week:560Down
User Ratings User Comments (4)
 All time
Utility:80%StarStarStarStarStar
Consistency:80%StarStarStarStarStar
Documentation:75%StarStarStarStar
Examples:70%StarStarStarStar
Tests:-
Videos:-
Overall:62%StarStarStarStar
Rank:895
 
that's good.
13 years ago (Nam Nguyen)
80%StarStarStarStarStar
Thank you for that!
13 years ago (Simon)
77%StarStarStarStar
Hi, I have a problem, how can i do ,i'm using PHP Version 5.
15 years ago (kasmeesee)
40%StarStarStar
It need just a little more documentation to install, (ie.
15 years ago (Francisco Garcia)
75%StarStarStarStar