-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathredirect.php
More file actions
42 lines (38 loc) · 1.15 KB
/
redirect.php
File metadata and controls
42 lines (38 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
<?php
declare(strict_types=1);
$message = $_GET['message'] ?? 'Something Went Wrong...';
$destination = match ($_GET['destination']) {
'login' => [
'url' => '/user/login.php',
'name' => 'Login'
],
'users' => [
'url' => '/user/view.php',
'name' => 'Users'
],
'content' => [
'url' => '/content/view.php',
'name' => 'Content'
],
default => [
'url' => '/',
'name' => 'Home'
]
};
header("Refresh: 3;" . $destination['url']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Seemus | Logout</title>
<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/template/metadata.template.php'; ?>
<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/template/bootstrap.template.php'; ?>
</head>
<body>
<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/template/header.template.php'; ?>
<main class="container">
<h2 class="my-3"><?= htmlspecialchars($message) ?></h2>
<p class="lead my-3">You will be redirected to <a href="<?= htmlspecialchars($destination['url']) ?>"><?= htmlspecialchars($destination['name']) ?></a> in 3 seconds...</p>
</main>
</body>
</html>