-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
67 lines (54 loc) · 1.73 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
55
56
57
58
59
60
61
62
63
64
65
66
<?php
require_once 'assets/config/config.php';
require_once "vendor/autoload.php";
require_once 'assets/functions/procedural_database_functions.php';
require_once 'assets/functions/login_functions.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$result = login($_POST['user']['username'], $_POST['user']['hashed_password'], $pdo, 'admins');
if ($result) {
header("Location: index.php");
exit();
}
echo "failed!";
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=yes, initial-scale=1.0">
<title>Login</title>
<link rel="stylesheet" media="all" href="assets/css/miniature.css">
</head>
<body class="site">
<div class="nav">
<input type="checkbox" id="nav-check">
<h3 class="nav-title">
The Photo Tech Guru
</h3>
<div class="nav-btn">
<label for="nav-check">
<span></span>
<span></span>
<span></span>
</label>
</div>
<div class="nav-links">
<a href="index.php">Home</a>
<a href="#">Register</a>
</div>
</div>
<form class="checkStyle" method="post" action="login.php">
<div class="screenName">
<label class="text_username" for="username">Username</label>
<input id="username" class="io_username" type="text" name="user[username]" value="" required>
</div>
<label class="text_password" for="password">Password</label>
<input id="password" class="io_password" type="password" name="user[hashed_password]" required>
<div class="submitForm">
<button class="submitBtn" id="submitForm" type="submit" name="submit" value="login">Login</button>
</div>
</form>
</body>
</html>