PHP Classes

SMK User Authentication: Authenticate users with MySQL database records

Recommend this page to a friend!
  Info   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 61%Total: 2,752 All time: 1,375 This week: 455Up
Version License Categories
smk_auth 1.0GNU General Publi...Databases, User Management


This package can be used to authenticate users against a MySQL database of user records.

It can verify whether there is a record for an active user given the user name and password.

If the authentication succeeds, it creates a record for a new session in another database table.

The new session identifier is set to a session cookie. This cookie can be verified in subsequent accesses to determine whether the user was previously authenticated and the session did not expire.

Picture of Andrei
Name: Andrei <contact>
Classes: 1 package by
Country: Romania Romania
Age: 49
All time rank: 115628 in Romania Romania
Week rank: 259 Up5 in Romania Romania Up


Fist of all, this package is based on the authentication used in mambo/joomla, also including the database object of this premium CMS ( . The files are altered to ensure stand-alone functioning of the classes. Mostly i worked on auth.class.php, in database.php i just got out some code that dd not make sense outside the joomla framework Installing ============= 1. Import the "script.sql" in your MySQL Database (It adds a default user "Testman", password "t") 2. Alter the accourding to your system setup. Please adjust the SESSION timeout since it is maybe to high for you. 3. Build a login page similar to my example "login.php". you should include the two files require_once('auth.class.php'); require_once(''); 4. in all the "registered only" pages include "require_once('auth.php')" on top. Please check "index.php" Please write me if you find some bugs or problems Enjoy Andrei

  Files folder image Files  
File Role Description
Plain text file auth.class.php Class Core Authentication class
Accessible without login Plain text file auth.php Aux. Authentication module
Plain text file database.php Class Database Class (a light version of the one included in the joomla distribution)
Accessible without login Plain text file Conf. Configuration script. Adjust to your Mysql configuration
Accessible without login Plain text file index.php Example Example file that uses authentication
Accessible without login Plain text file login.php Example Example login script.
Accessible without login Plain text file Readme.txt Doc. Documentation, how-to-install
Accessible without login Plain text file script.sql Data Table creation script

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:1,375
This week:455Up
User Ratings User Comments (1)
 All time
Very useful authentication class.
16 years ago (Alex Capalneanu)