$oForm->data = $_POST; $oForm->checkRequired("MemberName"); $oForm->checkRequired("MemberPassword"); $oForm->checkRequired("MemberEmail"); //checkEqual doesn't work. $oForm->checkEqual("MemberPassword", "ConfirmPassword"); if ($oForm->valid == true) { $oNewMember = new Member(); $oNewMember->MemberName = $_POST["MemberName"]; $oNewMember->MemberPassword = password_hash($_POST["MemberPassword"], PASSWORD_DEFAULT); $oNewMember->MemberEmail = $_POST["MemberEmail"]; $oNewMember->save(); header("Location:login.php"); exit; } } $oForm->makeTextInput("Name", "MemberName"); $oForm->makePasswordInput("Password", "MemberPassword"); $oForm->makePasswordInput("Confirm Password", "ConfirmPassword"); $oForm->makeTextInput("Email", "MemberEmail"); $oForm->makeSubmit("Register!"); ?> <div class="mainBackground"> <h3>Register</h3> <?php echo $oForm->html; ?> </div> <?php require_once 'includes/footer.php';
if ($bLoaded == false) { $oForm->raiseCustomError("Email", '<p class="validate">Bad Email!</p>'); } else { if ($oCheckCustomer->Password != $_POST["Password"]) { $oForm->raiseCustomError("Password", '<p class="validate">Bad Password!</p>'); } } if ($oForm->valid == true) { $_SESSION['CustomerID'] = $oCheckCustomer->CustomerID; $oCart = new Cart(); // // $oCart->add(1); // // $oCart->add(5); // // $oCart->add(5); // // $oCart->add(4); $_SESSION["cart"] = $oCart; //redirect header("Location:my_account.php"); exit; } } $oForm->makeTextInput("Email", "Email"); $oForm->makePasswordInput("Password", "Password"); $oForm->makeSubmit("Log In"); ?> <?php echo $oForm->html; ?> <?php require_once "includes/footer.php";
$oForm->raiseCustomError("MemberEmail", "Please Enter Valid Email"); } else { if (password_verify($_POST["MemberPassword"], $oTestMember->MemberPassword) == false) { $oForm->raiseCustomError("MemberPassword", "Please Enter Valid Password"); } else { //record the CustomerID to session $_SESSION["MemberID"] = $oTestMember->MemberID; header("Location:viewCategories.php?CategoryID=6"); //redirect to exit; } } } } $oForm->makeTextInput("Email", "MemberEmail"); $oForm->makePasswordInput("Password", "MemberPassword"); $oForm->makeSubmit("Login"); ?> <div class="mainBackground"> <h3 class="titleHeader">Login</h3> <?php echo $oForm->html; ?> <h3 class="titleHeader">Dont have an account? <a href="register.php">Register Here</a></h3> </div>
$oCustomer = new Customer(); $oCustomer->Name = $_POST["Name"]; $oCustomer->Address = $_POST["Address"]; $oCustomer->Phone = $_POST["Phone"]; $oCustomer->Email = $_POST["Email"]; $oCustomer->Password = $_POST["Password"]; $oCustomer->save(); header("Location:congrats.php"); exit; } } $oForm->makeTextInput("Name", "Name"); $oForm->makeTextInput("Address", "Address"); $oForm->makeTextInput("Phone", "Phone"); $oForm->makeTextInput("Email", "Email"); $oForm->makePasswordInput("Password", "Password"); $oForm->makePasswordInput("Confirm Password", "Confirm_Password"); $oForm->makeSubmit("Sign Up"); ?> <?php echo $oForm->html; ?> <!-- <form class="register" action="" method="post"> <div class="row"> <label for="">Name</label> <input type="text" name="firstName" id="firstNname" value=""> </div> <div class="row">