PHP Classes / The Login Class

Autenticate users with records in a MySQL database

The Login Class PHP Class

This is a simple class can be used to authenticate users with records stored in a MySQL database table. It looks up in a given MySQL table for the password of a given user, and checks if the password matches a given value entered by the user being authenticated. If there is a record for the specified user and the password is correct, the class sets a session variable with the user name and returns the code 1. If the password is incorrect, it returns the code 2. If there is no user with the specified user name, it returns 0. The class may also check encoded passwords stored after using the MD5 hash function.

Similar PHP Classes

Search in PHP Classes

Filter by tags