-
Notifications
You must be signed in to change notification settings - Fork 6
/
userinsert.php
81 lines (53 loc) · 1.94 KB
/
userinsert.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>SLOCV Unit</title>
<link rel="icon" type="image/png" href="228-2285847_emblem-of-sri-lanka-national-emblem-of-sri.png">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
</head>
<body style="background-color: grey">
<div class="div_content_login">
<div style="margin-top: 250px">
<?php
;
extract($_POST);
include("DBconnection.php");
$sql=mysqli_query($conn,"SELECT * FROM patients where patientEmail='$email'");
if(mysqli_num_rows($sql)>0)
{
echo "<h1 align='center' class='alert-info'>This Email Id Already Exists</h1>";
echo "<button class='btn btn-danger btn-block' ><a style='color: white' href='register.php'>Back to Register</a></button>";
exit;
}
if(isset($_POST['submit']))
{
$name=$_POST['name'];
$email=$_POST['email'];
$password=$_POST['password'];
$city=$_POST['city'];
$nic=$_POST['nic'];
$sql = "INSERT INTO patients "."(name, patientEmail, password, city, nic)"."VALUE('$name','$email','$password','$city','$nic')";
$results = mysqli_query($conn, $sql);
if(!$results) {
die('Could not enter data: '.mysqli_error($conn));
}
else
{
header("Location:loginindex.php");
}
}
?>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>