-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlogg.php
More file actions
59 lines (53 loc) · 1.54 KB
/
logg.php
File metadata and controls
59 lines (53 loc) · 1.54 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
<?php include_once("functions.php"); ?>
<?php
$username = null;
$password = null;
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if(!empty($_POST["username"]) && !empty($_POST["password"])) {
$username = $_POST["username"];
$password = $_POST["password"];
if($username == 'admin' && $password == 'admin') {
session_start();
$_SESSION["authenticated"] = 'true';
header('Location: search-id-1.php');
}
else {
header('Location: login.php');
}
} else {
header('Location: login.php');
}
} else {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Creating a simple to-do application - Part 1</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="page">
<!-- [banner] -->
<header id="banner">
<hgroup>
<h1>Login</h1>
</hgroup>
</header>
<!-- [content] -->
<section id="content">
<form id="login" method="post">
<label for="username">Username:</label>
<input id="username" name="username" type="text" required>
<label for="password">Password:</label>
<input id="password" name="password" type="password" required>
<br />
<input type="submit" value="Login">
</form>
</section>
<!-- [/content] -->
</div>
<!-- [/page] -->
</body>
</html>
<?php } ?>