aboutsummaryrefslogtreecommitdiff
path: root/www/failure.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/failure.php')
-rw-r--r--www/failure.php75
1 files changed, 75 insertions, 0 deletions
diff --git a/www/failure.php b/www/failure.php
new file mode 100644
index 0000000..976e414
--- /dev/null
+++ b/www/failure.php
@@ -0,0 +1,75 @@
+<?php
+session_start();
+$db = new SQLite3("../database/sqlite.db");
+include("include.php");
+if(!empty($_GET)){
+ switch($_GET["e"]){
+ case("401"):
+ $message = "Access forbidden";
+ break;
+
+ case("403"):
+ $message = "Access forbidden";
+ break;
+
+ case("404"):
+ $message = "404 - File Not Found";
+ break;
+
+ case("500"):
+ $message = "Server fault.";
+ break;
+
+ case("502"):
+ $message = "Bad Gateway";
+ break;
+
+ case("504"):
+ $message = "Someone other is too slow. I can't wait forever.";
+ break;
+
+ default:
+ $message = "200 / Everything is okay.";
+ break;
+ }
+} else {
+ header("Refresh: 0; https://".$_SERVER["HTTP_HOST"]."/");
+ exit;
+ $message = "200 / Everything is okay.";
+}
+
+?><!doctype html>
+<html>
+<head>
+ <title>Failure :: Junge Gemeinde Adlershof</title>
+ <meta http-equiv='Content-type' content='text/html; charset=utf-8' />
+ <link rel='stylesheet' type='text/css' href='/static/hyperstyle.css' />
+ <link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'>
+</head>
+<?php include("static/head.php"); ?>
+
+<br><br>
+<div id='content_container' align='center'>
+ <div class='kleineschrift'><div class='ueberschrift'><b><p style='text-decoration:underline;'><?php echo $message; ?></p></b></div></div>
+
+<br><br>
+ <p style='font-size:14px'>Upps, it seems to be something went wrong, sorry.</p>
+ <p style='font-size:14px'>Have a random quote to bridge the time. Try to reload the site or check for typos in the URL.</p>
+<?php
+ $rows = $db->query("SELECT count(*) as count FROM sprueche;");
+ $row = $rows->fetchArray();
+ $numRows = $row["count"];
+
+ $zufall = mt_rand(1,$numRows);
+ $ergebnis = $db->query("SELECT * FROM sprueche where id=$zufall;");
+?>
+ <br>
+ <div id='container' align='center'>
+ <br><br><br>
+ <b>Zitat Nummer #<?php echo $zufall; ?></b><br><br><div id='bgcolor'>
+<?php
+ while($row=$ergebnis->fetchArray()){
+ echo $row["spruch"];
+ }
+?></div>
+</div>