Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Databasing
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 11-03-2009, 08:43 PM
  #1
mattmill30
Soldier (Level 11)
 
Join Date: Oct 2006
Posts: 133
iTrader: (0)
mattmill30 is an unknown quantity at this point
Unhappy mysql password field not decrypting

Hi,

I'm having a simular problem to:

http://www.htmlforums.com/databasing...on-117058.html

However, i'm using the password('') encryption function.

Essentially, when i SELECT * FROM users WHERE password=password('$password'), no rows are returned.

Interesting if i remove password('') and just leave password=$password, and then enter the encrypted form of the password as $password, it returns a row.

The source code i'm using is:

PHP Code:
    $email=$_POST['email'];
    
$password=$_POST['password'];
    
$host="host"// Host name 
    
$db_username="dbusername";
    
$db_password="dbpassword";
    
$db_name="dbname";
    
$tbl_name="users";
    
$sql="SELECT * FROM $tbl_name WHERE user_email='$email' AND user_password=password('$password')";
    
$con mysql_connect($host$db_username$db_password)or die("cannot connect");
    
mysql_select_db($db_name$con)or die("cannot select DB"); 
    
$result=mysql_query($sql);
    if (
$email != "") {
        
$count=mysql_num_rows($result);
        echo 
"Number of Rows: ";
        
print_r ($count);
        echo 
"<br />";
    }
?> 
An example is available here:

http://tendervendors.com/dev/testing...trownumber.php - only checks username
http://tendervendors.com/dev/testing...trownumber.php - userpass checks username and password('$password')

Using Credentials:
Username: test@hostroute.com
Password: 12345

I've reported this to the host company, because i'm sure its not the code, but its not the first/last time i'll be wrong.

Has anyone got any ideas where the fault could be?

Thanks for any help,

Matthew Millar

Last edited by mattmill30 : 11-04-2009 at 04:11 PM. Reason: didn't add user_password=password('') to example
mattmill30 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  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
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 05:24 PM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.