-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.php
122 lines (113 loc) · 3.68 KB
/
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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
require 'db.php';
if(isset($_POST['join'])){
$uname=$_POST['username'];
$uphone=$_POST['phone'];
$uemail=$_POST['email'];
$upassword=$_POST['password'];
$ubirthday=$_POST['birthday'];
if(empty($uname) || empty($uphone) || empty($uemail) || empty($upassword) || empty($ubirthday)){
echo "<script>
$('#join-button').html('<img src=loading.gif width=20px height=20px>');
function loaderr(){
$('#error').css('display','block');
$('#error').html('All fields are required');
$('#join-button').html('Join');
}
setTimeout(loaderr,4000);
clearInterval();
</script>";
}
elseif (strlen($uname) <3) {
echo "<script>
$('#join-button').html('<img src=loading.gif width=20px height=20px>');
function loaderr(){
$('#error').css('display','block');
$('#error').html('Username is too short <span class=close onclick=hideresponse() id=close>×</span>');
$('#join-button').html('Join');
}
setTimeout(loaderr,4000);
clearInterval();
</script>";
}elseif (strlen($uname) >16) {
echo "<script>
$('#join-button').html('<img src=loading.gif width=20px height=20px>');
function loaderr(){
$('#error').css('display','block');
$('#error').html('Username is too long <span class=close onclick=hideresponse() id=close>×</span>');
$('#join-button').html('Join');
}
setTimeout(loaderr,4000);
clearInterval();
</script>";
}
elseif (!is_numeric($uphone)) {
echo "<script>
$('#join-button').html('<img src=loading.gif width=20px height=20px>');
function loaderr(){
$('#error').css('display','block');
$('#error').html('Fake phone number<span class=close onclick=hideresponse() id=close>×</span>');
$('#join-button').html('Join');
}
setTimeout(loaderr,4000);
clearInterval();
</script>";
}
elseif(strlen($upassword) < 6){
echo "<script>
$('#join-button').html('<img src=loading.gif width=20px height=20px>');
function loaderr(){
$('#error').css('display','block');
$('#error').html('Password is too short <span class=close onclick=hideresponse() id=close>×</span>');
}
setTimeout(loaderr,4000);
clearInterval();
</script>";
}elseif ($upassword==$uname || $upassword==$uemail || $upassword==$uphone) {
echo "<script>
$('#join-button').html('<img src=loading.gif width=20px height=20px>');
function loaderr(){
$('#error').css('display','block');
$('#error').html('Please Use a more secure Password <span class=close onclick=hideresponse() id=close>×</span>');
$('#join-button').html('Join');
}
setTimeout(loaderr,4000);
clearInterval();
</script>";
}else{
$sql="SELECT username,email FROM artiste_info WHERE username='$uname' OR email='$uemail'";
$result=mysqli_query($conn,$sql);
if(mysqli_num_rows($result) > 0){
echo "<script>
$('#join-button').html('<img src=loading.gif width=20px height=20px>');
function loaderr(){
$('#error').css('display','block');
$('#error').html('Username or Email already taken <span class=close onclick=hideresponse() id=close>×</span>');
$('#join-button').html('Join');
}
setTimeout(loaderr,4000);
clearInterval();
</script>";
}else{
include_once 'class_register.php';
$user=new register($_POST['username'],$_POST['phone'],$_POST['email'],$_POST['password'],$_POST['birthday']);
$user->getinfo();
$value=$_POST['username'];
setcookie("user",$value,time()+(86400 * 180),'/');
$email=$_POST['email'];
setcookie("email",$email,time()+(86400 * 180),'/');
$phone=$_POST['phone'];
setcookie("phone",$phone,time()+(86400 * 180),'/');
echo "<script>
$('#join-button').html('<img src=loading.gif width=20px height=20px>');
function hi(){
window.location.href='home.php';
}
setTimeout(hi,4000);
clearInterval();
</script>";
}
}
mysqli_close($conn);
}
?>