Last active
August 29, 2015 14:18
-
-
Save freundTech/474dd86aa65bd4119b73 to your computer and use it in GitHub Desktop.
Ajax php fallback
This file contains 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
<?php | |
ob_start(); | |
chdir("./content"); | |
$file = "./".$_GET["page"].".php"; | |
if(!file_exists($file)) | |
{ | |
$file = "./404.php"; | |
} | |
include($file); | |
chdir(".."); | |
$content = explode("----------", ob_get_clean()); | |
?> | |
<div id="title_menu"> | |
<? echo $content[0]; ?> | |
</div> | |
<div id="content"> | |
<? echo $content[1]; ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment