-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
54 lines (51 loc) · 1.12 KB
/
login.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
<!DOCTYPE html>
<?php session_start(); ?>
<html>
<head>
<title>Login page</title>
<style type="text/css">
#login-box{
width: 25%;
margin: 7em auto;
border: 1px solid black;
border-radius: 5px;
padding: 10px;
}
#login-box > input{
display: block;
width: 90%;
margin: 0 auto;
margin-bottom: 10px;
}
</style>
</head>
<body>
<?php
if($_POST){
$username=$_POST['username'];
$pass=$_POST['pass'];
if($username=="Salman" && $pass=="123456")
{
echo '<span>Login Successful!
waiting for Blog page</span>';
$_SESSION['user']=$username;
$_SESSION['college']="AIKTC";
$_SESSION['class']="TE";
header("Refresh:2, url=blog.php");
}
else
{
echo '<span> Incorrect Username Or Password!</span>';
}
}
?>
<form method="post" action="login.php">
<div id="login-box">
<span>Log In</span>
<input type="text" name="username" id="username" placeholder="Username" required="required"/>
<input type="password" name="pass" id="pass" placeholder="Password" required="required"/>
<input type="submit" name="" value="Log In"/>
</div>
</form>
</body>
</html>