Fehler und Ausnahmekonzept

This commit is contained in:
2026-05-05 09:27:45 +00:00
parent 0556dec11d
commit 4fac3121f3
5 changed files with 31 additions and 17 deletions
+19 -5
View File
@@ -11,6 +11,8 @@ setcookie("Image2Food", time(), time() + (60 * 60 * 24 * 120));
if (0 > version_compare(PHP_VERSION, '7')) {
die('<h1>Für diese Anwendung ' . 'ist mindestens PHP 7 notwendig');
}
class MeineAusnahme extends Exception{};
?>
@@ -25,12 +27,24 @@ if (0 > version_compare(PHP_VERSION, '7')) {
<div id="nav">
<?php
if (isset($_SESSION["login"]) && ($_SESSION["login"] == "true")) {
require ("navmitglieder.php");
try {
if (isset($_SESSION["login"]) && ($_SESSION["login"] == "true")) {
if (@include("navmitglieder.php"));{
throw new MeineAusnahme();
}
}
else {
if (@include("nav.php"));{
throw new MeineAusnahme();
}
}
} catch (MeineAusnahme $e) {
die("<h1>Image2Food - Sag mir was ich daraus kochen kann</h1>
<h2>Das soziale, multimediale Netzwerk für Kochideen</h2>
<p> Leider gibt es ein Problem mit der Webseite.
Wir arbeiten daran mit Hochdruck. Besuchen Sie uns in kürze wieder enu</p>");
}
else {
require("nav.php");
}
?>
</div>
<div id="content">