-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hlogin.php
34 lines (26 loc) · 921 Bytes
/
Hlogin.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
<?php
session_start();
$uname=$_POST['username'];
$pwd2=$_POST['password'];
$conn = new mysqli("dbms.iiitdmj.ac.in","2016135","be5acb71","2016135");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT *FROM Hospital WHERE HospitalID = '$uname' AND Password = '$pwd2'";
$result = $conn->query($sql);
$num_row = $result->num_rows;
$row = $result->fetch_assoc();
if($num_row > 0 )
{
$_SESSION["HName"]=$row["HospitalName"];
$_SESSION['HAddress']=$row['HospitalAddress'];
$_SESSION['HMobile']=$row['HospitalMobile'];
$_SESSION['HID']=$row['HospitalID'];
$_SESSION['HEmail']=$row['Email'];
echo "true";
}
else
{
echo "false";
}
?>