20) $error .= "Your password must be less than 20 characters in length."; elseif(strlen($cnewpass) == 0) $error .= "Please confirm your new password."; elseif($newpass != $cnewpass) $error .= "Your new password confirmation does not match."; else { $check_pass = mysql_query("SELECT COUNT(id) AS total FROM users WHERE id = ".$_SESSION['sess_userid']." AND password = MD5('".$currentpass."')"); if(mysql_result($check_pass, 0, total) != 1) $error = "The current password you've entered does not match the one we have on record, please try again."; } if(strlen($error) == 0) { // commit $currentpass = strtolower(trim($currentpass)); $newpass1 = strtolower(trim($newpass)); $update_client = mysql_query("UPDATE users SET password = MD5('".preparedata($newpass)."') WHERE id = ".$_SESSION['sess_userid']." LIMIT 1"); if($update_client) $success = "Your account password has successfully been updated."; else $error = "We could not update your account password, please try again later."; } } include("header.php"); ?>
Change Password:

Use the following form to amend your account password. Please enter your current password for security then your new password twice for confirmation:


0) echo show_error($error)."

"; elseif(strlen($success) > 0) { echo show_success($success)."

"; echo "
"; include("footer.php"); exit; die(); } ?>
Current Password:
  
New Password:
Confirm New Password: