source

Below is the source code used to render my portfolio site. The script includes files to create the HTML header and footer as well as the navigation links. It also dynamically includes content files based on the contents of the page variable.
The highlight_file() function was used to generate the source code.

<?php
    
if (isset($_REQUEST["page"]))
        
$page preg_replace("[a-zA-Z]"" "$_REQUEST["page"]);
    else
        
$page "main";
    
$fpage "./inc_" $page ".php";
    
    include_once(
"index_header.php");
    include_once(
"index_navi.php");
    
    echo(
"\n<div id=\"content\">\n");
            if (isset(
$page) && file_exists($fpage))
                include(
$fpage);
            else
                include(
"./inc_main.php");
    echo(
"\n</div>\n");
    include_once(
"index_footer.php");    ?>

Footer:

        <div id="footer">
            <p>HendrixWeb &copy;Michael Hendrix 2011-2012</p>
            <?php
                
if (isset($page) && file_exists($fpage))
                {
                    if (
$page != "source")
                        print(
"<p><a href=\"http://validator.w3.org/unicorn/check?ucn_uri=referer&amp;ucn_task=conformance\" class=\"new-window\"><img src=\"img/valid.png\" width=\"165\" height=\"15\" alt=\"Valid XHTML1.1\" title=\"Valid XHTML1.1 and CSS\" /></a></p>");

                    
$sub_fpage substr($fpage6, -4) . " page";    //strip filetype and such from filename
                    
echo("<p>$sub_fpage last modified: " date("Y-m-d H:i:s."filemtime($fpage)) . "</p>");
                }    
?>
        </div>
    </div>
</body>

</html>