Skip to content

Instantly share code, notes, and snippets.

@freundTech
Last active August 29, 2015 14:18
Show Gist options
  • Save freundTech/474dd86aa65bd4119b73 to your computer and use it in GitHub Desktop.
Save freundTech/474dd86aa65bd4119b73 to your computer and use it in GitHub Desktop.
Ajax php fallback
<?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