-
Notifications
You must be signed in to change notification settings - Fork 0
/
patient.php
107 lines (105 loc) · 2.51 KB
/
patient.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
session_start();
$message="";
if(count($_POST)>0) {
$con = mysqli_connect('localhost','root','','testdb') or die('Unable To connect');
$result = mysqli_query($con,"SELECT * FROM patient WHERE email='" . $_POST["username"]. "' and password= '".$_POST['pwd']."';");
$row = mysqli_fetch_array($result);
if(is_array($row)) {
$_SESSION["id"] = $row['ID'];
$_SESSION["Name"] = $row['Name'];
$_SESSION["email"]=$row['email'];
$_SESSION["tim"]=time();
} else {
$message = "Invalid Username or Password!";
}
}
if(isset($_SESSION["id"])) {
header("Location:patient_dash.php");
}
?>
<html>
<head>
<style>
body{
margin:0px;
background : linear-gradient(to bottom, #33ccff 0%, #ff99cc 100%);
}
.container{
padding:10px;
position:fixed;
top:50%;
left:50%;
transform: translate(-50%,-50%);
width:200px;
box-shadow:10px 15px 135px ;
background-color:white;
border-radius:5%;
}
.form-group{
margin-bottom:1em;
}
.form-label{
display:block;
transform:translateY(-1.25em);
transform-origin:0 0;
transition:all .3s;
}
.form-control{
width:100%;
height:2em;
border-style:none none solid none;
transition:all .5s;
}
.form-control::placeholder{
color:transparent;
}
.form-control:focus{
outline:none;
box-shadow:none;
border-color:orange;
}
.form-control:focus + .form-label,
.form-control:not(:placeholder-shown) + .form-label
{
transform:translateY(-2.25em);
}
h1{
color:black;
}
.form-submit{
background-image: linear-gradient(to bottom, #33ccff 0%, #ff99cc 100%);
width:100%;
radius:5%;
height:2em;
border:none;
font-size:1em;
font-weight:bold;
color:white;
}
.message{
color:red;
}
</style>
</head>
<body>
<div class="container">
<h1><center>Login</center></h1>
<div class="message"><?php if($message!="") { echo $message; } ?></div>
<form action="" method="POST" class="form" autocomplete="off">
<div class="form-group">
<input type="text" name="username" class="form-control" placeholder="name">
<label class="form-label">username</label>
</div>
<div>
<input type="password" name="pwd" class="form-control" placeholder="password">
<label class="form-label">password</label>
</div>
<input type="submit" name="submit" value="Log in" class="form-submit">
</form>
<div>
<a href="signup_patient.html">Are you a new patient??</a>
</div>
</div>
</body>
</html>