-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoctorSignup.php
More file actions
34 lines (25 loc) · 859 Bytes
/
doctorSignup.php
File metadata and controls
34 lines (25 loc) · 859 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
<?php
require "connection.php";
header('location:index.php');
$name = $_POST['username'];
$email = $_POST['email'];
$pass = $_POST['password'];
$phone = $_POST['phone'];
$q = " select * from doctors where name = '$name' && email = '$email' ";
$result = mysqli_query($con, $q);
$num = mysqli_num_rows($result);
if ($num == 1) {
echo " user already present";
} else {
$qy = " insert into doctors(name , email , phone_no , password) values('$name', '$email', '$phone', '$pass') ";
mysqli_query($con, $qy);
$result = mysqli_query($con, $q);
while ($row = mysqli_fetch_assoc($result)) {
$_SESSION['currentUser_id'] = $row['doctor_id'];
$_SESSION['currentUser'] = $row['name'];
$_SESSION['currentUserEmail'] = $row['email'];
$_SESSION['user'] = "Doctor";
header('location:index.php');
}
}
?>