-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocregistration.php
51 lines (38 loc) · 1.21 KB
/
docregistration.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
<?php
session_start();
$con=mysqli_connect('localhost','root','');
mysqli_select_db($con,'hms');
$docid= $_POST['doctorid'];
$docname= $_POST['doctorname'];
$spec = $_POST['spec'];
$password = $_POST['password'];
$cpassword = $_POST['cpassword'];
$fees = $_POST['fees'];
if($password != $cpassword){
echo "<script>alert('password is mismatching.... please re-enter your password ');</script>";
?>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://localhost/hospital/adddoctor.html">
<?php
}
else{
$s = "select * from doctable where docid='$docid'";
$result = mysqli_query($con, $s);
$num = mysqli_num_rows($result);
if($num==1)
{
echo "doctorid already taken";
?>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://localhost/hospital/adddoctor.html">
<?php
}
else
{
$reg="insert into doctable(docid,docname,specilaization,password,confirmpassword,consultancyfees) values ('$docid','$docname','$spec','$password','$cpassword','$fees')";
mysqli_query($con,$reg);
echo"<script>window.alert('Details Entered Successfully');</script>";
?>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://localhost/hospital/adminsignin.html">
<?php
}
}
?>