Return to Snippet

Revision: 43151
at March 18, 2011 00:14 by Guitaraholic


Initial Code
<?php include('header.php'); ?>

<?php include('navigation.php'); ?>

        <div id="contentwrap">

<?php

$default = "home.php";

$allowed = array (
);

chdir("pages/");

if( isset( $_POST["page"] ) || isset( $_GET["page"] ))
        {
        $page = isset($_GET["page"]) ? $_GET["page"] : $_POST["page"];

        if( in_array( trim ( $page ), $allowed ))
                {
                $file = $page . ".php";
                if( (file_exists( $file )))
                        {
                        include( $file );
                        }
                else
                        {
                        include( $default);
                        }
                }
        else
                {
                include( $default);
                }
        }
else
        {
        include( $default );
        }
?>

        </div><!-- end contentwrap -->



<?php include('footer.php'); ?>

Initial URL


Initial Description


Initial Title
PHP flat site html index.php : easy content switch

Initial Tags


Initial Language
PHP