PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Click Here
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old July 8th, 2002, 07:57 PM
mhoward mhoward is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UK
Posts: 49 mhoward User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
secure md5 authentication with mysql

I have added users into my mysql database using
$password = "mypassword";

$secure_password = md5($password);
mysql_connect(etc...etc...)
INSERT INTO dbname etc...

Anyway, that all works fine, but no I want to authenticate users securely using my login page.

My fields are user_name & user_pass. I have connected to my database but can't authenticate users correctly.

I have tried...

$access_password = md5($user_pass);

if($user_pass == "username" && $access_password == "password"); but to no avail!

Suggestions and help appreciated

Thanks

Reply With Quote
  #2  
Old July 9th, 2002, 10:51 AM
greggory greggory is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Reims, France
Posts: 82 greggory User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: secure md5 authentication with mysql

Try to get the line according to user/password using something like:
php Code:
Original - php Code
  1.  
  2. <?php
  3. $r = mysql_query( "select from users where username = '$user_pass' and password = '".md5($access_password)."'" );
  4.  
  5. if ( mysql_numrows( $r ) < 1 )
  6. {
  7.   die( "Access Denied" );
  8. }
  9. else
  10. {
  11.   // Access granted
  12. }
  13. ?>

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > secure md5 authentication with mysql


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway