-
Notifications
You must be signed in to change notification settings - Fork 1
/
login.php
47 lines (40 loc) · 1.42 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
<?php
session_start();
include('settings.php');
$error = "";
if(isset($_POST['username'],$_POST['password'])){
$user = array(
"user" => $USERNAME,
"pass" => $PASSWORD
);
$username = $_POST['username'];
$pass = $_POST['password'];
if($username == $user['user'] && $pass == $user['pass']){
//session_start();
$_SESSION['raflogin'] = $username;
header('Location: index.php');
exit;
}else{
echo '<div class="loginecho alert alert-danger" style="margin: 10px auto; width: 360px;">Login failed</div>';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<form style="width: 360px; margin: 10px auto;" accept-charset="UTF-8" role="form" method="post" action="login.php">
<fieldset>
<div class="form-group">
<input class="form-control" placeholder="Username" name="username" type="text">
</div>
<div class="form-group">
<input class="form-control" placeholder="Password" name="password" type="password" value="">
</div>
<input class="btn btn-lg btn-block" style="background-color: #38abe3; color: #fff" type="submit" value="Login">
</fieldset>
</form>
</body>
</html>