-
Notifications
You must be signed in to change notification settings - Fork 0
/
registration.php
51 lines (40 loc) · 1.16 KB
/
registration.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
<?php include('conn/connection.php'); ?>
<?php
if(isset($_POST['SignUp']))
{
$name = $_POST['user'];
$email = $_POST['email'];
$address = $_POST['address'];
$tel = $_POST['tel'];
$pass = $_POST['password'];
$cpass = $_POST['cpassword'];
$query="SELECT * from users where u_name='$name'";
$sql=mysqli_query($conn,$query);
$num=mysqli_num_rows($sql);
if($name=="" || $email=="" || $address=="" || $tel=="" || $pass=="" || $cpass=="")
{
echo "<script type=\"text/javascript\"> alert(\"Please fillup field corectly..!\")</script>";
}
else
{
if($pass==$cpass)
{
if($num == 1)
{
echo "<script type=\"text/javascript\"> alert(\"Username already exsisted..!\")</script>";
}
else
{
$reg="INSERT INTO users VALUES('$name','$email','$address','$tel','$pass','$cpass')";
mysqli_query($conn,$reg);
echo "<script type=\"text/javascript\"> alert(\"Succesfully Registered..!\")</script>";
header('location:login.php');
}
}
else
{
echo "<center>passwords are not matched</center>";
}
}
}
?>