Forget Password Page
I have all ready set up a user_registration table that contains the information that I am trying to retrieve. Nonetheless, the send_password_ac.php is unable to locate the email address in the database that is in the database. I have created a forget the forgot_password.php (search page not shown) and I have created the send_password_ac.php (results page) see below:
//Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect to server");
mysql_select_db("$db_name")or die("cannot select DB");
// value sent from form
$register_pemail_to=$_POST['register_pemail_to'];
// table name
$tbl_name="user_registration";
// retrieve password from table where email = $register_pemail_to…
$sql="SELECT register_pass FROM $tbl_name WHERE register_pemail='$register_pemail_to'";
$result=mysql_query($sql);
// if found this e-mail address, row must be 1 row
// keep value in variable name "$count"
$count=mysql_num_rows($result);
// compare if $count =1 row
if($count==1){
$rows=mysql_fetch_array($result);
// keep password in $your_password
$your_password=$rows['register_pass'];
When the code is run what I get in return is “Could not find email in database. Please try again”. So, I know I am able to connect to the database but what I don’t get is why it is not able find email field (register_pemail) in the database. Any help would be appreciated.
hjohnson2011
