-
Notifications
You must be signed in to change notification settings - Fork 1
/
auth.blade.php
64 lines (41 loc) · 1.21 KB
/
auth.blade.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
$error[] = "";
if(isset($_SERVER["REQUEST_METHOD"]) == "POST" && isset($_POST["firstname"]) && isset($_POST["lastname"]) && isset($_POST["username"]) && isset($_POST["email"]) && isset($_POST["gender"]) && isset($_POST["password"]) && isset($_POST["submit"])){
include_once "function.php";
$uid = "";
if(!empty($_POST["firstname"])){
$fname = secure($_POST["firstname"]);
}else{
$error[] = "FirstName Is Empty";
}
if(!empty($_POST["lastname"])){
$lname = secure($_POST["lastname"]);
}else{
$error[] = "LastName Is Empty";
}
if(!empty($_POST["username"])){
$username = secure($_POST["username"]);
}else{
$error[] = "Username Is Empty";
}
if(!empty($_POST["email"])){
$email = check_email($_POST["email"]);
}else{
$error[] = "Email Is Empty";
}
if(!empty($_POST["password"])){
$password = encode_password($_POST["password"]);
} else{
$error[] = "Password Is Empty";
}
$gender = $_POST["gender"];
if(!empty($error)){
register_user($uid, $fname, $lname, $username, $email, $gender, $password, $conn);
}else{
echo"Error Occurred";
}
echo $error[0];
}else{
echo"error occurred";
}
?>