-
Notifications
You must be signed in to change notification settings - Fork 3
/
connect.php
36 lines (26 loc) · 1.01 KB
/
connect.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
<?php
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$username = $_POST['username'];
$password = $_POST['password'];
$conpassword=$_POST['conpassword'];
$city = $_POST['city'];
$mobile = $_POST['mobile'];
if (!empty($firstname) || !empty($lastname) || !empty($username) || !empty($password) || !empty($conpassword) || !empty($city) || !empty($mobile))
{
include("root/db_connection.php");
$sql=$db->query("select username from user_info where username='$username'");
if($sql->rowCount()==0 && $password==$conpassword){
$q =$db->query("insert into user_info(firstname,lastname,username,password,city,mobile) values('$firstname','$lastname','$username','$password','$city','$mobile')") or die(" ");
echo"successfully added";
}
else
echo "already username exist or passsword and confirm password dosent match";
}
else
{
echo"PLEASE FILL ALL THE FIELDS PRESENT IN SIGN UP BOX";
die(" ");
}
header("location:register1.php?status=Data Saved successfully");
?>