Page 1 of 1

MD5 troubles...

Posted: Thu Aug 05, 2004 9:45 pm
by dwfait
Hi. Ill post my code and then explain whats wrong.

Code: Select all

$mpass=MD5("$pass");

mysql_query("INSERT INTO sspp SET id='',user='$user',pass='$mpass',fname='$fname',lname='$lname',nname='$nname',staff='No',email='$email'");
Now, whatever $pass is, the MD5 value of it always comes out in the database as:
b148e7f41fdc3be4b14e8d17e068bbad

Can anyone help or do i need to post more code?

Posted: Thu Aug 05, 2004 9:50 pm
by Joe
$mpass=MD5($pass);

Posted: Thu Aug 05, 2004 9:59 pm
by feyd
are you sure $pass is actually set? is register_globals on?

Posted: Thu Aug 05, 2004 10:02 pm
by Joe
Im pretty sure he/she does. After calculating the string $pass through an md5 calculator I was resulted with the exact md5 hash which was given. I am also pretty sure that anything placed in between quotes of the md5 function is treated as an individual string. Perhaps im wrong!

Posted: Thu Aug 05, 2004 10:04 pm
by dwfait
Hi, thanks joe, it worked :)

Posted: Thu Aug 05, 2004 10:04 pm
by Joe
no problem :)