Blame Scripts/CentOS-Web/contents/single.php

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

The page $id isn't readable!

";
1f953a
        }
1f953a
1f953a
    } 
1f953a
    else {
1f953a
        echo "

The page $id doesn't exist!

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