-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
64 lines (56 loc) · 1.69 KB
/
index.php
File metadata and controls
64 lines (56 loc) · 1.69 KB
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
<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Login</title>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/animate.css">
<link rel="stylesheet" href="css/styles.css">
</head>
<body style="background-color:skyblue">
<div id="container">
                                                  <font size ="2">New User</font> <font size="2" color="blue"><a href="welcome.php">Register</a></font>
<form #action="store.php" method = "post">
<label>Username:</label>
<input type="name" name="username" />
<label>Password:</label>
<p>
<a href="forget.php">Forgot your password?</a>
<input type="password" name="password" />
<div id="lower">
<input type="checkbox">
<label class="check" for="checkbox">Keep me logged in</label>
<input type="submit" value="Login">
<?php
$new = 0;
$con = mysql_connect("localhost","root","");
if(!$con)
{
die("Connection Failed");
}
if(!(mysql_select_db("medical_inventory", $con)))
{
die ("Database Not Selected");
}
if (isset($_POST['username']) && isset($_POST['password']))
$query = "SELECT * FROM login ";
if (isset ($query))
$sql = mysql_query($query,$con);
if (isset ($sql))
{
while($row = mysql_fetch_array($sql))
{
if(($row['username'] == $_POST['username']) && ($row['password'] == $_POST['password']))
$new = 1;
}
if(!$new)
echo "<br /> <font size='1' color='red'>Wrong Username or Password</font>";
}
if($new)
header ("Location:option.php");
?>
</div>
</form>
</div>
</body>
</html>