List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:March 4 2004 7:14pm
Subject:Re: Logging in Users
View as plain text  
Erich Beyrent wrote:
> Hi all,
> 
> I need some advice as to how to manage a user login system using PHP and
> MySQL.  Currently, I have the following table:
> 
> +-------------+--------------+------+-----+---------+----------------+
> | Field       | Type         | Null | Key | Default | Extra          |
> +-------------+--------------+------+-----+---------+----------------+
> | MemberID    | bigint(20)   |      | PRI | NULL    | auto_increment |
> | MemberFname | varchar(30)  |      |     |         |                |
> | MemberLname | varchar(40)  |      |     |         |                |
> | Login       | varchar(8)   |      |     |         |                |
> | Password    | varchar(32)  |      |     |         |                |
> | Bio         | text         | YES  |     | NULL    |                |
> | Address     | varchar(127) | YES  |     | NULL    |                |
> | City        | varchar(40)  | YES  |     | NULL    |                |
> | State       | char(2)      | YES  |     | NULL    |                |
> | Zip         | int(5)       | YES  |     | NULL    |                |
> | Phone       | varchar(20)  | YES  |     | NULL    |                |
> | Cell        | varchar(20)  | YES  |     | NULL    |                |
> | Email       | varchar(40)  | YES  |     | NULL    |                |
> +-------------+--------------+------+-----+---------+----------------+
> 
> And my PHP function looks like this:

Add a unique key on Login, and make sure to properly escape user input with 
mysql_real_escape_string() or mysql_escape_string() in older PHP versions.

-- 
Sasha Pachev
Create online surveys at http://www.surveyz.com/
Thread
Logging in UsersErich Beyrent4 Mar
  • Re: Logging in UsersSasha Pachev4 Mar