-
Notifications
You must be signed in to change notification settings - Fork 0
/
action_signup.php
31 lines (26 loc) · 918 Bytes
/
action_signup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
if(isset($_POST["submit"])){
$name = $_POST["fullname"];
$email = $_POST["email"];
$username = $_POST["username"];
$password = $_POST["password"];
require_once 'dbconnection.php';
require_once 'function.php';
if(emptyInputSignup($name, $email, $username, $password) !== false){
header("location: signup.php?error=Fill all fields");
exit();
}
if(invalidEmail($email) !== false){
header("location: signup.php?error=Invalid email");
exit();
}
if(usernameExists($conn, $username, $email) !== false){
header("location: signup.php?error=Username or email already exists");
exit();
}
createUser($conn, $name, $email, $username, $password);
}
else{
header("location: signup.php?error=Try again");
exit();
}