parent
d24f8fde32
commit
a1a09f081f
64
index.php
64
index.php
|
@ -1,8 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
include("render.php");
|
|
||||||
|
|
||||||
$path = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
|
$path = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
|
||||||
|
|
||||||
if ($path == "/admin") {
|
if ($path == "/admin") {
|
||||||
$_SERVER["PHP_SELF"] = $path;
|
$_SERVER["PHP_SELF"] = $path;
|
||||||
include("phpliteadmin.php");
|
include("phpliteadmin.php");
|
||||||
|
@ -20,27 +17,58 @@ $stmt->bindValue(":path", $path);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$target = $result["target"];
|
$target = $result["target"];
|
||||||
header("Location: {$target}");
|
header("Location: {$target}");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
$body = "";
|
<!DOCTYPE html>
|
||||||
if ($path != "/") {
|
<html lang="en">
|
||||||
$body =
|
<head>
|
||||||
"<b>Link not found</b><br /><br />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
The short URL https://fwdkr.co{$path} could not be found.<br /><br />
|
|
||||||
<br /><br />";
|
|
||||||
}
|
|
||||||
$body .=
|
|
||||||
"<b>About fwdkr.co</b><br /><br />
|
|
||||||
You've arrived at this page because you typed or linked to \"fwdkr.co\", the URL shortcut for
|
|
||||||
<a href=\"https://fwdekker.com/\">fwdekker.com</a>.<br /><br />
|
|
||||||
|
|
||||||
Whenever you see a \"fwdkr.co\" link, you can trust that it will always take you to a website affiliated with
|
<title>FWDekker</title>
|
||||||
FWDekker.";
|
|
||||||
|
|
||||||
render_page("FWDekker", $body);
|
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
font-family: "Roboto", sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:link, a:visited, a:hover, a:active {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wrapper {
|
||||||
|
margin: auto;
|
||||||
|
padding-top: 50px;
|
||||||
|
|
||||||
|
width: 50%;
|
||||||
|
max-width: 800px;
|
||||||
|
min-width: 400px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="wrapper">
|
||||||
|
<h1><a href="https://fwdekker.com/">FWDekker</a></h1>
|
||||||
|
<?php
|
||||||
|
if ($path != "/") {
|
||||||
|
?>
|
||||||
|
<b>Link not found</b><br /><br />
|
||||||
|
The short URL https://fwdkr.co<?= $path ?> could not be found.<br /><br />
|
||||||
|
<br /><br />
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<b>About fwdkr.co</b><br /><br />
|
||||||
|
You've arrived at this page because you typed or linked to "fwdkr.co", the URL shortcut for
|
||||||
|
<a href="https://fwdekker.com/">fwdekker.com</a>.<br /><br />
|
||||||
|
|
||||||
|
Whenever you see a "fwdkr.co" link, you can trust that it will always take you to a website affiliated with
|
||||||
|
FWDekker.
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
45
render.php
45
render.php
|
@ -1,45 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Renders a simply fwdkr.co page.
|
|
||||||
*
|
|
||||||
* @param string $title the page's title, as displayed in the tab
|
|
||||||
* @param string $body the bit of text to display to the user
|
|
||||||
*/
|
|
||||||
function render_page(string $title, string $body)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
|
|
||||||
<title><?= $title ?></title>
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
|
|
||||||
<style>
|
|
||||||
* {
|
|
||||||
font-family: "Roboto", sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:link, a:visited, a:hover, a:active {
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
#wrapper {
|
|
||||||
margin: auto;
|
|
||||||
padding-top: 50px;
|
|
||||||
|
|
||||||
width: 50%;
|
|
||||||
max-width: 800px;
|
|
||||||
min-width: 400px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="wrapper">
|
|
||||||
<h1><a href="https://fwdekker.com/">FWDekker</a></h1>
|
|
||||||
<?= $body ?>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html><?php
|
|
||||||
}
|
|
Loading…
Reference in New Issue