public function test_CreateForgotPage($ans, $note) { require_once '../Controller/StudentController.php'; $studentController = new StudentController(); $result = $studentController->CreateForgotPage(); $result = trim($result); $ans = trim($ans); //$ans = trim ( $ans," \t\n\r\0\x0B" ); //$ans =trim($ans,"\n"); //string trim ( string $str [, string $character_mask = " \t\n\r\0\x0B" ] ) //print_r($result); //echo "\n\n"; //print_r($ans); //exit(); //var_dump(strcmp($result,$ans)); //exit(); if ($result == $ans) { $ans = "PASSED"; } else { $ans = "FAILED"; } return $test = "Testing CreateForgotPage()<br /><b>note:</b> {$note}\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\tTest: " . $ans . "<br />"; }
session_start(); if (isset($_POST['textbox_newPass']) || isset($_POST['textbox_secretAns'])) { if (isset($_POST['textbox_newPass']) && isset($_POST['textbox_secretAns'])) { $email = $_SESSION['forgotPassword']; $found = $studentController->resetPassword($email, $_POST['textbox_secretAns'], $_POST['textbox_newPass']); } else { $found = "You must fill both Secret Answer and New Password feilds before proceeding"; } if (isset($_SESSION['forgotPassword'])) { unset($_SESSION['forgotPassword']); } } else { if (isset($_POST['textbox_txt'])) { $found = $studentController->findStudentAccount($_POST['textbox_txt']); } else { $found = $studentController->CreateForgotPage(); } } $title = "Forgot Password"; $content = $found; //include 'Styles/ManageTemplate.php'; include 'template.php'; ?>