Creating a Table with User and Psw

Security issues related to php and mysql usage. How to make your code secure? Security measures and configurations? It's all in here!

Moderators: macek, egami, gesf

luitron
New php-forum User
New php-forum User
Posts: 2
Joined: Sat Jul 05, 2003 3:48 pm

Creating a Table with User and Psw

Postby luitron » Sat Jul 05, 2003 3:53 pm

I have this loging script and all i need is to create a table like this:
+----+----------+------------------+
| id | username | password |
+----+----------+------------------+
| 1 | john | 2ca0ede551581d29 |
| 2 | joe | 7b57f28428847751 |
| 3 | tom | 675bd1463e544441 |
| 4 | bill | 656d52cb5d0c13cb |
+----+----------+------------------+

please any help will do :D

liquedus
php-forum Active User
php-forum Active User
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada
Contact:

Postby liquedus » Sat Jul 05, 2003 5:27 pm

create table yournamehere (id int auto_increment primary key, username varchar(20), password varchar(50))

and i am guessing that all the passwords have to be md5'ed

hope that helps :)

luitron
New php-forum User
New php-forum User
Posts: 2
Joined: Sat Jul 05, 2003 3:48 pm

Postby luitron » Sat Jul 05, 2003 6:00 pm

thanks that helps alot :D

patna_in
New php-forum User
New php-forum User
Posts: 103
Joined: Sun Feb 06, 2005 10:54 am
Contact:

Postby patna_in » Sun Feb 06, 2005 11:06 am

Now how i match this password with a password given by a php driven site.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Fri Feb 11, 2005 1:40 pm

the password that you are getting from a user should be md5 encoded.. then you simply try to selelct the user with that use4rname and that md5 encoded password... in case you get 0 rows: wrong username or password error should be thrown..


Return to “PHP & MySQL Security”

Who is online

Users browsing this forum: No registered users and 0 guests

cron