-
Notifications
You must be signed in to change notification settings - Fork 8
/
page.php
46 lines (43 loc) · 1.31 KB
/
page.php
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
<?php
$request = preg_replace('/[^0-9a-z-_]/', '', preg_replace('/^\//', '', preg_replace('/\/$/', '', preg_replace('/\?.*$/', '', $_SERVER['REQUEST_URI']))));
if (file_exists('demos/' . $request . '.html')) {
$file = file_get_contents('demos/' . $request . '.html');
preg_match('/<title>(.*)<\/title>/', $file, $matches);
$file = preg_replace('/<title>(.*?)<\/title>/', '', $file);
$title = $matches[1];
$manifest = '';
if ($request == 'offlineapp') { // specific change to support <html manifest=xyz>
$manifest = ' manifest="html5demo.appcache"';
}
include('includes/header.php');
echo $file;
include('includes/header.php');
echo $file;
include('includes/footer.php');
} else {
header("HTTP/1.0 404 Not Found");
echo 'File not found';
include('includes/footer.php');
} else {
header("HTTP/1.0 404 Not Found");
echo 'File not found';
}
?>
include('includes/header.php');
echo $file;
include('includes/footer.php');
} else {
header("HTTP/1.0 404 Not Found");
echo 'File not found';
include('includes/header.php');
echo $file;
include('includes/footer.php');
} else {
header("HTTP/1.0 404 Not Found");
echo 'File not found';
include('includes/header.php');
echo $file;
include('includes/footer.php');
} else {
header("HTTP/1.0 404 Not Found");
echo 'File not found';