Home › Forums › JavaScript › ajax load php into page div › Re: ajax load php into page div
January 30, 2013 at 11:50 am
#122847
Member
I think I found a solution and I think I probably should’ve started a new thread with my question. Please just delete my two posts. FWIW, here’s what I did.
put the following in the content.php file
$default = “info/pageone.php”;
$allowed = array (
‘info/pagetwo’,
‘info/pagethree’,
);
if( isset( $_POST[“P”] ) || isset( $_GET[“P”] ))
{
$page = isset($_GET[“P”]) ? $_GET[“P”] : $_POST[“P”];
if( in_array( trim ( $page ), $allowed ))
{
$file = $page . “.php”;
if( (file_exists( $file )))
{
include( $file );
}
else
{
include( $default );
}
}
else
{
include( $default );
}
}
else
{
include( $default );
}
?>
navigation.php has: