-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.php
56 lines (56 loc) · 982 Bytes
/
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
<html>
<?php
$servername='localhost';
$username='root';
$password='';
$db='project';
$user=$_POST['user'];
$pass=$_POST['password'];
$conf=$_POST['cpassword'];
$email=$_POST['email'];
$conn=mysqli_connect($servername,$username,$password,$db);
if(!$conn)
{
die('Could not connect:'.mysqli_error());
}
else
{
if($pass==$conf)
{
$sql="insert into signup values('$user','$pass','$email');";
$res=mysqli_query($conn,$sql) or mysqli_error($conn);
if($res==TRUE)
{
?>
<script>
var r = confirm("User Account created successfully!!!");
if (r == true) {
window.location.href = "signin.html";
} else {
window.location.href = "signup.html";
}
</script>
<?php
}
else
{
?>
<script>
alert('Enter the correct details');
window.location.href = "signup.html";
</script>
<?php
}
}
else
{
?>
<script>
alert('Enter the correct password');
window.location.href = "signup.html";
</script>
<?php
}
}
?>
</html>