Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "../inc/account-manager.inc.php";
- if(isset($_POST['email'])
- && isset($_POST['username'])
- && isset($_POST['password'])
- && isset($_POST['confirm_password'])){
- $username = $_POST['username'];
- if(strlen($username) >= 32){
- header("Location: ./create-account.php?msg=uname_long");
- }
- if(user_exists($username)){
- header("Location: ./create-account.php?msg=user_exists");
- }else{
- $email = $_POST['email'];
- if(email_in_use($email)){
- header("Location: ./create-account.php?msg=email");
- }else{
- $password = $_POST['password'];
- if($password != $_POST['confirm_password']){
- header("Location: ./create-account.php?msg=password_match");
- }else{
- $last_name = isset($_POST['last_name']) ? $_POST['last_name'] : null;
- $first_name = isset($_POST['first_name']) ? $_POST['first_name'] : null;
- $birthday = isset($_POST['birthday']) ? $_POST['birthday'] : null;
- if(create_account($email, $username, $password, $last_name, $first_name, $birthday)){
- header("Location: ./create-account.php?msg=account_created");
- }else{
- header("Location: ./create-account.php?msg=error");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement