Created
October 14, 2012 23:26
-
-
Save themasch/3890144 to your computer and use it in GitHub Desktop.
CMS in 10 Zeilen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <htmlzeugsblafoo> | |
| <?php | |
| $request = $_SERVER['DOCUMENT_ROOT'] . $_SERVER['REQUEST_URI']; | |
| $dirname = __DIR__ . '/'; | |
| $request = preg_replace('(^'.$dirname.')', '', $request); | |
| $page = trim($request, '/'); | |
| $path = './content/' . $page . '.html'; | |
| $allowed = array_merge(glob('./content/*.html'), glob('./content/*/*.html')); | |
| if(in_array($path, $allowed)) include $path; | |
| else include './content/home.html'; | |
| ?> | |
| </htmlzeugsblafoo> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment