-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.php
39 lines (33 loc) · 1.31 KB
/
index.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
<?php
/**********************************************************
Vanilla Kit
Copyright 2013 Paulo Nunes
https://github.com/syndicatefx/vanilla-kit
Author Paulo Nunes (syndicatefx.com)
All Vanilla Kit code is licensed under the MIT License:
http://opensource.org/licenses/MIT
Basically, you can do whatever you want as long as you
include the original copyright.
***********************************************************
This file controls what pages to load based on user input.
No need to edit it unless you know what you are doing!
**********************************************************/
// Defualt page will always be pages/homepage.html, if not, change this to
// the name of the file you have created to be the homepage.
$page = 'homepage';
// Lets get pages based on user input
if (!empty($_GET['name'])) {
//Assign a variable to a sanitised version of the data passed in the URL
$tmp_page = basename($_GET['name']);
//If the file exists, update $page
if (file_exists("pages/{$tmp_page}.html"))
$page = $tmp_page;
//If the file does not exist, include our custom notfound page and don't run anymore code
elseif(!file_exists($tmp_page)){
include 'pages/notfound.html';
exit;
}
}
// Include $page (declared default)
include ("pages/$page.html");
?>