' . "\r\n"; include("includes/functions.php"); $Status = $_REQUEST['Status']; $Submit = $_POST['Submit']; $resetID = $_REQUEST['resetID']; $password = $_POST['password']; $Error = ""; if($Submit == "Cancel"){ header("Location:listingManage.php"); }else if($Submit == "Update Password"){ //Check Required Fields $resetID = $_POST['resetID']; // Get this hidden valie from the POST not the REQUEST $email = $_POST['email']; // Get this hidden valie from the POST if (empty($resetID)){ $Error .= "resetID-"; } if (empty($password)){ $Error .= "password-"; }else{ if(strlen($password)<7){ $Error .= "password-"; } } if(!empty($Error)){ $Status = "Incomplete"; }else{ $password = md5($password); $statement = "update users set password = '%s' where email = '%s'"; //Put message in table with status = preview $sql1 = sprintf($statement, $password, $email); //print($sql1); //once it is in the table, redirect to a preview screen if ($con->query($sql1) === TRUE) { //if logged in go to dashboard if(isset($_SESSION['UserLogin'])){ header("Location:dashboard.php?Status=PswRstSuccess"); }else{ //if not logged in go to login header("Location:login.php?Status=PswRstSuccess"); } } else { $Error .= "database-"; echo "Error: " . $sql1 . "
" . $con->error; } } } if(!$Error){ $sql2 = "select userID from resets where resetID = '$resetID'"; //print($sql2); $result2 = mysqli_query($con,$sql2); $count2 = mysqli_num_rows($result2); if ($count2 > 0){ $row2 = mysqli_fetch_array($result2); $email = $row2['userID']; //print($email); }elseif(empty($email)){ header("Location:login.php?Status=PswRstBroken"); } } ?> Picture Music Message | Home

Change Password

Hello , enter your new password below

Please fix the highlighted fields below - Passwords must be at least 8 characters long"); }else if($Status == "Success"){ print("

Successfully Updated Your Password

"); }else if($Status == "Error"){ print("

There was an error completing your request. Please contact your administrator

"); } ?>
class="error" >Password