I hope some one would be able to help me here. I have a forgot password script that automatically generate the password and mail it back to user if user put his email address and it create the password in md5 format and successfully update the database password filed. Now my problem is the login scripts i have it does not work. The password that mailed out to user does not work. But if I copy the whole password filed and use that to log in it works. I believe it is my login scripts that is not coverting the plaintext to md5 format. Here is my login scripts part....
*** PLEASE USE THE
Code: Select all
TAG WHEN POSTING CODE ***[/color]Code: Select all
$userid=mysql_real_escape_string($userid);
$password=mysql_real_escape_string($password);
if($rec=mysql_fetch_array(mysql_query("SELECT * FROM tbl_login WHERE userid='$userid' AND password = '$password'"))){
if(($rec['userid']==$userid)&&($rec['password']==$password)){
include "include/newsession.php";