Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript ajax load php into page div Re: ajax load php into page div

#122847
jawmoke
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:

Page One    
Page Two     
Page Three