
<?php 
    $dir = 'pages/*.html';
    $files = glob($dir);    

    if(empty($files)) {
        die("Error: No HTML files found in /pages directory");
    }

    $randomPage = $files[array_rand($files)];

    echo file_get_contents($randomPage);
?>
       