-
Notifications
You must be signed in to change notification settings - Fork 0
/
cus_reg.php
138 lines (98 loc) · 3.25 KB
/
cus_reg.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html>
<head>
<title>Cure All</title>
<meta charset="utf-8">
<link href="layout.css" rel="stylesheet" type="text/css" media="all">
</head>
<body id="top">
<div class="wrapper row1">
<header id="header" class="clear">
<div id="logo" class="fl_left">
<h1><a href="index.html">Cure all</a></h1>
</div>
</header>
</div>
<div class="wrapper row2">
<nav id="mainav" class="clear">
<ul class="clear">
<li class="button"><a href="index.html">Home</a></li>
<li class ="button"><a href="Emed.php">E-Medicine</a></li>
<li class ="button"><a href="Doctors.php">Doctors</a></li>
<li class ="button"><a href="LOGIN.php"> LOGIN</a></li>
</ul>
</nav>
</div>
<div class="wrapper row3">
<main class="container clear">
<body>
<h2 align="center"> Customer Registration </h2>
<form action="cus_reg.php" method="POST">
<label>Name :</label><input type="text" name="nam" required>
<label>Age :</label><input type="number" name="age" required>
<label>gender :</label>
<input type="radio" name="gen" required value="Male"/>Male
<input type="radio" name="gen" required value="Female"/>Female
<label>Blood Group :</label><select name="bgroup">
<option value="O+"> O+</option>
<option value="O-">O-</option>
<option value="A+">A+</option>
<option value="A-">A-</option>
<option value="B+">B+</option>
<option value="B-">B-</option>
<option value="AB+">AB+</option>
<option value="AB-">AB-</option><br>
</select>
<label>E-mail :</label><input type="mail" name="mai" required>
<label>Phone.No :</label><input type="tel" name="pho" required>
<label>User :</label><input type="text" name="user" placeholder="Ron23-4-1997" pattern="[A-Za-z]{3}[0-9]{2}/[0-9]{2}/[0-9]{4}"required> (Enter your name's three letters followed by your birth date )
<label>Password :</label><input type="password" name="pass" required>
<label>Address:</label><input type="var" name="addr" required>
<label>City :</label><input type="var" name="cit" required>
<br>
<label>Medical History :</label><textarea rows="4" cols="80" name="mh">Medical History if any...</textarea><br>
<input type="submit" value="Register" name="submit">
</form>
<?php
if(isset($_POST["submit"]))
{
$nam = $_POST['nam'];
$age = $_POST['age'];
$gen = $_POST['gen'];
$bgroup = $_POST['bgroup'];
$mai = $_POST['mai'];
$pho = $_POST['pho'];
$user = $_POST['user'];
$pass = $_POST['pass'];
$addr = $_POST['addr'];
$cit = $_POST['cit'];
$mh = $_POST['mh'];
$dbc = mysqli_connect('localhost', 'root', '123456', 'cureall')or die('Error connecting to MySQL server.');
$query = "INSERT INTO cus_login(user,pass) VALUES('$user','$pass')";
$resul = mysqli_query($dbc,$query);
$sql = "INSERT INTO cur(nam,age,gen,bgroup,mai,pho,user,pass,addr,cit,mh) VALUES('$nam','$age','$gen','$bgroup','$mai','$pho','$user','$pass','$addr','$cit','$mh')";
$result = mysqli_query($dbc,$sql);
if($result && $resul)
{
echo "Successfully sent";
}
else
{
echo "Change User ";
}
}
?>
</div>
<div class="wrapper row4">
<footer id="footer" class="clear">
<div class="row">
</footer>
</div>
</div>
<div class="wrapper row5">
<div id="copyright" class="clear">
<p class="fl_left">©Reserved by Avan avi</p>
</div>
</div>
</body>
</html>