Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $username = htmlentities(trim($_POST['txt_username']));
- $unpass = htmlentities(trim($_POST['txt_password']));
- $password = password_hash($unpass, PASSWORD_BCRYPT, ['cost' => 12] );
- $unemail = $_POST['txt_email'];
- $email = filter_var($unemail, FILTER_VALIDATE_EMAIL);
- if (isset($_POST['btn_signup']) ){
- if($guest->check_user_exists($username)){
- $errors[]= "Username Already Taken";
- }
- elseif(strlen($username) < 6){
- $errors[] = "Username must be at least 6 characters";
- }
- elseif(strlen($unpass) < 6){
- $errors[] = "Password must be at least 6 characters";
- }
- elseif($guest->check_email_exists($email)){
- $errors[]= "Email Already Taken";
- }
- elseif($guest->signup($email,$password,$username)){
- header("Location:index.php?registered");
- die('didnt redirect');
- }
- else{
- $errors[]= "Invalid Entry";
- }
- }
Add Comment
Please, Sign In to add comment