-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuserregistrtioncode.php
More file actions
41 lines (38 loc) · 1.67 KB
/
Copy pathuserregistrtioncode.php
File metadata and controls
41 lines (38 loc) · 1.67 KB
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
<?php
session_start();
include("admin/config/dbcon.php");
if (isset($_POST['submit'])) {
$fname = $_POST['txtfname'];
$lname = $_POST['txtlname'];
$dob = $_POST['txtdate'];
$gen = $_POST['txtgen'];
$email = $_POST['txtemail'];
$pass = $_POST['txtpass'];
$address = $_POST['txtaddress'];
$state = $_POST['txtstate'];
$city = $_POST['txtcity'];
$phno = $_POST['txtphone'];
if ($pass == $conpass) {
$qry1 = "select email from user where email='$email'";
$result = $con->query($qry1);
if (mysqli_num_rows($result)) {
$_SESSION['message'] = "Email Already Exiist";
echo "<script type='text/javascript'>window.top.location='userregistration.php';</script>";
} else {
$qry = "INSERT INTO `user`(`fname`, `lname`, `dob`, `gender`,`email`, `password`, `address`, `states`, `city`,`phnum`,`status`) VALUES ('$fname','$lname','$dob','$gen','$email','$pass','$address','$state','$city','$phno','pending')";
$result1 = $con->query($qry);
if ($result) {
$_SESSION['message'] = "Register Successfully";
echo "<script type='text/javascript'>window.top.location='login.php';</script>";
// echo "added susscessfully ";
} else {
$_SESSION['message'] = "Failed To Register";
echo "<script type='text/javascript'>window.top.location='userregistration.php';</script>";
}
}
} else {
$_SESSION['message'] = "Confirm Password and Password didn't Match";
// echo "<script type='text/javascript'>window.top.location='userregistration.php';</script>";
}
}
?>