<input class="btn btn-success" type="submit" value="Forgot your password?"> </form> <?php } elseif (isset($_POST['password'])) { ?> <form id="inputForm" data-user-type="Admin" action="aindex.php" method="post"> <img class="admin_L" src="img/mowlogogreen.png" height=45px alt="Meals On Wheels Logo"><br> <img class="admin_L" src="img/mowdeliverygreen.png" height=35px alt="Delivery Logo"><br><br> <div>Password Recovery</div> <?php $sID = $_POST['uID']; $password = $_POST['password']; // Get security question $question = saveNewPassword($sID, $password); ?> <span><div id="errorMSG">New Password Has Been Created</div></span><br> <a href="aindex.php"><button class="btn btn-success"> Back to login </button></a> </form> <?php } elseif (isset($_POST['answer'])) { ?> <form id="inputForm" data-user-type="Admin" action="passwordRecovery.php" method="post"> <img class="admin_L" src="img/mowlogogreen.png" height=45px alt="Meals On Wheels Logo"><br> <img class="admin_L" src="img/mowdeliverygreen.png" height=35px alt="Delivery Logo"><br><br> <div>Password Recovery</div> <?php
$response["error"] = TRUE; $response["error_msg"] = "Error occured in Operation, Try again"; echo json_encode($response); } } else { // user is NOT existed - error response $response["error"] = TRUE; $response["error_msg"] = "User does NOT exist!"; echo json_encode($response); } } else { if ($tag == 'change_password') { $email = $_POST['email']; $new_entered_password = $_POST['new_password']; if (isUserExisted($email, $db)) { $is_stored_new_password = saveNewPassword($email, $new_entered_password, $db); if ($is_stored_new_password != false) { $response["error"] = FALSE; echo json_encode($response); } else { $response["error"] = TRUE; $response["error_msg"] = "Error occured in Operation, Try again"; echo json_encode($response); } } else { // user is NOT existed - error response $response["error"] = TRUE; $response["error_msg"] = "User does NOT exist!"; echo json_encode($response); } } else {