-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdoctorsignup_action.php
More file actions
41 lines (40 loc) · 989 Bytes
/
doctorsignup_action.php
File metadata and controls
41 lines (40 loc) · 989 Bytes
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
<?php
include "connection.php";
session_start();
$name=$_REQUEST['name'];
$dob=$_REQUEST['dob'];
$email=$_REQUEST['email'];
$pass=$_REQUEST['pass'];
$cpass=$_REQUEST['cpass'];
$spe=$_REQUEST['specialization'];
$mno=$_REQUEST['mno'];
$otpc = $_SESSION["otp"];
$otp=$_REQUEST["otp"];
$select="select * from doctorsignup";
$res=mysqli_query($conn,$select);
$flag=false;
while ($row=mysqli_fetch_array($res)){
if($row[0] == $mno){
$flag=false;
break;
}
}
if($flag == true){
header("location:usersignup.php?msg=Mobile already exists");
}
else{
if($pass == $cpass){
if($otp == $otpc && $otp!="")
{
$insert = "insert into doctorsignup values('$mno','$email','$name','$dob','$pass','$otp','$spe')";
mysqli_query($conn, $insert);
header("location:usersignup.php?msg=Doctor Signed up successfully");
}
else{
header("location:usersignup.php?msg=Wrong OTP");
}
}
else{
header("location:usersignup.php?msg=Check Password");
}
}