-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
53 lines (42 loc) · 1.15 KB
/
Copy pathindex.php
File metadata and controls
53 lines (42 loc) · 1.15 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
<?php
session_start();
$_SESSION["csrf_token"] = bin2hex(random_bytes(32));
session_write_close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles/font.css" />
<link rel="stylesheet" href="styles/index.css" />
<link rel="icon" href="assets/favicon.ico" />
<title>PHP Authentication</title>
</head>
<body>
<div class="menu">
<a href="https://github.com/hosseinyn/PHP-Authentication">GitHub</a>
Created by PHP , MySQL
</div>
<h1 style="margin-top: 50px">PHP Authentication</h1>
<div style="text-align: center;"><img src="assets/icon.png" alt="icon" /></div>
<p>There are your options : </p>
<?php
session_start();
if (!isset($_SESSION["loggedIn"]) || $_SESSION["loggedIn"] !== true) {
echo <<<HTML
<div class="options-button">
<a href="pages/login.php"><button>Login</button></a>
<a href="pages/register.php"><button>Register</button></a>
</div>
HTML;
} else {
echo <<<HTML
<div class="options-button">
<a href="pages/dashboard.php"><button>Dashboard</button></a>
<a href="operations/logout.php"><button>Log out</button></a>
</div>
HTML;
}
?>
</body>
</html>