-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.php
More file actions
52 lines (33 loc) · 1.06 KB
/
Copy pathinsert.php
File metadata and controls
52 lines (33 loc) · 1.06 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
42
43
44
45
46
47
48
49
50
51
52
<?php
include 'db.php';
if (isset($_POST['submit']))
;
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$password = $_POST['password'];
$confirmpassword = $_POST['confirmpassword'];
/* dishant email query */
$checkuser = "SELECT * FROM register_user WHERE email = '$email'";
$result = mysqli_query($conn, $checkuser);
$count = mysqli_num_rows($result);
if ($count > 0) {
echo "<script>
alert('Email already exists');
window.location.replace('Register.php');
</script>";
} else {
$sql = "insert into register_user(id,firstname,lastname, email,phone,password,confirmpassword)
values( '','$firstname','$lastname','$email','$phone','$password','$confirmpassword')";
$query = mysqli_query($conn, $sql);
if ($query) {
echo " <script>
alert('Data Inserted Successsfully');
window.location.replace('Register.php');
</script>";
} else {
echo "Data Not Inserted Successfully";
}
}
?>