I do apologise before hand if there is a script like this or if am just generally irritating. I've been staring at this script for two days now, and I can't figure out what's wrong with it. My problem deals with the "reset_pass.php" script. It's half taken from a book, half editted to my specs. I'm currently running PHP 4.4 I do believe so on the server. Now, the problem that am having is that everything works with the error part of the script - i.e.: if incorrect or incomplete email is typed, the error states it. However, if is a correct email, then the page just reverts back to itself (meaning, the script shows up, but no confirmation is stated or email sent.) [code]<? ob_start(); session_start(); DEFINE ('DB_USER', 'xxx'); DEFINE ('DB_PASSWORD', 'xxx'); DEFINE ('DB_HOST', 'localhost'); DEFINE ('DB_NAME', 'main'); $dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL:' . mysql_error() ); @mysql_select_db (DB_NAME) OR die ('Could not select the database:' . mysql_error() ); ?> <center> <? include ("../themes/eventures/header.php"); include("../topmenu.php"); include("../leftmenu.php"); ?> <center><b><p>Forgot Password</p></b></center> <p>Enter the email you used when registered to the site.</p> <form method="post" action="../client/forgot_pass.php"> <table border="0" cellpadding="3" cellspacing="1" > <tr> <td><b>Email: </b></td> <td> <input name="email" type="text" size="25" maxlength="50"><br /> <input type="submit" name="submitted" value="Reset Password"></p> <? $login = $_POST['login']; $email = $_POST['email']; $pass = $_POST['pass']; $temppass = $_POST['temppass']; $client_id = $_POST['client_id']; if (isset($_POST['submitted'])) { $errors = array(); if (empty($email)) { $errors[] = print '<p><b>Error:</b> Please enter your email.</P>'; } else { $email = trim($email); $query = "SELECT client_id, email FROM client WHERE email='$email'"; $result = mysql_query($query); $row = mysql_fetch_array ($result, MYSQL_ASSOC); if ($row) { $row['pass']; $row['email']; $row['client_id']; } else { $errors[] = print '<p><b>Error:</b> Email submitted does not match those on file.</p>'; } } if ($email == $row[pass]) { $temppass = substr ( md5(uniqid(rand(),1)), 3, 10); $temppass = $pass; $query = "SELECT client_id, email FROM client WHERE email='$email'"; $result = mysql_query ($query); $num = mysql_num_rows($result); if (mysql_num_rows($result) == 0) { $row = mysql_fetch_array ($result, MYSQL_NUM); $query = "UPDATE client SET pass=PASSWORD('$temppass') WHERE email='$email'"; $result = mysql_query ($query); if (mysql_affected_rows() == 1) { print '<p>Your password has been changed. An email has been sent to your account.</p>'; exit(); $body = "Your password has been temporarily changed to '$temppass'."; $body .= "You may login using this password, and upon login, change it.\r\n"; $body .= "Support at Electronic Commerce, Inc."; mail ($email, 'Your temporary password.', $body, 'From: support@electronic-commerce.us.com'); } else { $errors[] = print '<p><b>Error:</b> Your password could not be changed due to a system error.</p>' . mysql_error(); } mysql_close(); } else { $errors[] .= print '<p>Please try again.</p>'; } } } ?> </form> </td> </tr> </table> <? include ("../footer.php"); ?> </center>[/code] Am not certain, but could it be the update query? Any help would be greatly appreciated.