-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPage.php
More file actions
executable file
·48 lines (43 loc) · 1.35 KB
/
Page.php
File metadata and controls
executable file
·48 lines (43 loc) · 1.35 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
43
44
45
46
47
48
<?php // UTF-8 marker äöüÄÖÜ߀
abstract class Page
{
protected $database = null;
protected function __construct() {
$this->database = new MySQLi("xxx", "xxx", "", "tasks_db");
if (mysqli_connect_errno())
throw new Exception(mysqli_connect_error());
if (!$this->database->set_charset("utf8"))
throw new Exception($this->database->error);
}
protected function __destruct() {
$this->database->close();
}
protected function generatePageHeader($title = '') {
$title = htmlspecialchars($title);
header("Content-type: text/html; charset=UTF-8");
echo <<<EOT
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8"/>
<title>$title</title>
<link rel="stylesheet" type="text/css" href="style-sheet.css" />
<script src="sort.js"></script>
<script src="data.js"></script>
</head>
<body>
EOT;
}
protected function generatePageFooter() {
echo <<<EOT
</body>
</html>
EOT;
}
protected function processReceivedData() {
if (get_magic_quotes_gpc()){
throw new Exception("Bitte schalten Sie magic_quotes_gpc in php.ini aus!");
}
}
}
?>