-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
29 lines (29 loc) · 952 Bytes
/
index.php
File metadata and controls
29 lines (29 loc) · 952 Bytes
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
<?php
include 'config/settings.php';
include 'config/mysql.php';
if (!isset($_GET['page']) || $_GET['page'] == '') {
// Startseite ausgeben
include 'site/home.php';
} elseif (preg_match('/^[A-Z]$/', $_GET['page'])) {
// Straßenverzeichnis X ausgeben
$title = 'Strassenverzeichnis ' . urldecode($_GET['page']) . ' | ' . $title;
$canonical = $url . '/' . $_GET['page'];
include 'site/verzeichnis.php';
} elseif (in_array($_GET['page'], $static, true)) {
// Statische Seiten augeben
$canonical = $url . '/' . $_GET['page'];
include 'site/' . $_GET['page'] . '.php';
} else {
$stmt = $mysqli->prepare("SELECT strasse FROM strassen WHERE strasse = ? LIMIT 1;");
$stmt->bind_param("s", $_GET['page']);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows == 1) {
$title = urldecode($_GET['page']) . ' | ' . $title;
$canonical = $url . '/' . $_GET['page'];
include 'site/strassen.php';
} else {
include 'error404.php';
}
}
?>