-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpatregistration.php
50 lines (40 loc) · 1.26 KB
/
patregistration.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
<?php
session_start();
header('locaion:sighup.php');
$con=mysqli_connect('localhost','root','');
mysqli_select_db($con,'hms');
$fullname= $_POST['fullname'];
$userid= $_POST['userid'];
$email = $_POST['email'];
$phoneno = $_POST['phoneno'];
$password = $_POST['password'];
$cpassword=$_POST['cpassword'];
$gender = $_POST['gender'];
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/signup.html">
<?php
}
else{
$s = "select * from pattable where userid='$userid'";
$result = mysqli_query($con, $s);
$num = mysqli_num_rows($result);
if($num==1)
{
echo '<script>alert("username already taken")</script>';
?>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://localhost/hospital/signup.html">
<?php
}
else
{
$reg="insert into pattable(fullname,userid,email,phoneno, password,gender) values ('$fullname','$userid','$email','$phoneno','$password','$gender')";
mysqli_query($con,$reg);
echo '<script>alert("registration successfull")</script>';
?>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://localhost/hospital/signin.html">
<?php
}
}
?>