Blame Scripts/Php/Webenv/contents/single.php

878a2b
878a2b
878a2b
878a2b
/***
878a2b
 * Content Template
878a2b
 */
878a2b
878a2b
878a2b
// Initialize variables
878a2b
if ( isset($_GET['p']) ) {
878a2b
878a2b
    $id = $_GET['p'];
878a2b
    $file = "pages/p_$id.php";
878a2b
878a2b
    // Check file 
878a2b
    if (file_exists($file)) 
878a2b
    {
878a2b
        if (is_readable($file)) 
878a2b
        {
878a2b
            include($file);
878a2b
        } 
878a2b
        else {
878a2b
            echo "

The page $id isn't readable!

";
878a2b
        }
878a2b
878a2b
    } 
878a2b
    else {
878a2b
        echo "

The page $id doesn't exist!

";
878a2b
    }
878a2b
878a2b
} 
878a2b
else {
878a2b
878a2b
    $id = 0;
878a2b
    include("pages/p_index.php");
878a2b
878a2b
}
878a2b
878a2b
// Validate id value
878a2b
878a2b
?>
878a2b
878a2b