-
Notifications
You must be signed in to change notification settings - Fork 3
/
insertdoc.php
executable file
·79 lines (78 loc) · 1.75 KB
/
insertdoc.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
<?php include("config.php"); ?>
<h1>Insert New Doctor</h1>
<table>
<form method="post">
<tr>
<td>Name</td>
<td><input type="text" name="name" ></td>
</tr>
<tr>
<td>Email</td>
<td><input type="email" name="mail" ></td>
</tr>
<tr>
<tr>
<td>DOB</td>
<td><input type="date" name="dob" ></td>
</tr>
<tr>
<td>Gender</td>
<td><select name="gnd">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select></td>
</tr>
<tr>
<td>Address</td>
<td><input type="text" name="addr" ></td>
</tr>
<tr>
<td>Phone no.</td>
<td><input type="text" name="phno"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="text" name="pwd"></td>
</tr>
<tr>
<td>Fees</td>
<td><input type="text" name="fee"></td>
</tr>
<tr>
<td>Category</td>
<td><input type="text" name="category"></td>
</tr>
<tr>
<td><input type="submit" name="btn" value="Insert"></td>
</tr>
</form>
</table>
<?php
if (isset($_POST['btn'])) {
$name = $_POST['name'];
$email = $_POST['mail'];
$dob = $_POST['dob'];
$gnd = $_POST['gnd'];
$addr = $_POST['addr'];
$phno = $_POST['phno'];
$pwd = $_POST['pwd'];
$fee = $_POST['fee'];
$cat = $_POST['category'];
$res1 = mysqli_query($con,"INSERT INTO doctor (Name, Email, Dob, Gender, Address, Phoneno, Password, Fees, Category,Dp) VALUES ('$name','$email','$dob','$gnd','$addr','$phno','$pwd','$fee','$cat','')");
if($res1) {
?>
<script>
alert ("Added Sucessfully");
window.location.href = "update.php";
</script>
<?php
} else {
?>
<script>
alert ("Add Unsucessful");
window.location.href = "insertdoc.php";
</script>
<?php
}
}
?>