[b].htaccess[/b]
[code]
RewriteEngine On
RewriteRule ^upload/(.*).php$ highlighter.php?file=$1.php
[/code]

[b]highlighter.php[/b]
<?php
$ready = false;
if (isset($_GET['file']))
{
    $file = $_GET['file'];
    $pathinfo = pathinfo($file);
    $ext = $pathinfo['extension'];
    $bname = $pathinfo['basename'];
    if ($ext == 'php')
    {
        $file = 'upload/' . $file;
        if (file_exists($file))
        {
            echo '<link rel="stylesheet" href="../highlighter.css" type="text/css" />' . "\n";
            echo '<h1>Highlighter</h1>' . "\n";
            echo '<h2>' . $bname . '</h2>' . "\n";
            $highlighted = highlight_file($file, true);
            $lines = explode('<br />', $highlighted);
            echo '<table class="code">' . "\n";
            echo '<tr>' . "\n";
            echo '<td id="linenumbers">' . "\n";
            foreach ($lines as $lineID => $line)
            {
                $spaces = strlen(count($lines)) - strlen($lineID + 1);
                for ($i = 0; $i < $spaces; $i ++)
                {
                    echo '&nbsp;';
                }
                echo $lineID + 1 . '<br />' . "\n";
            }
            echo '</td>' . "\n";
            echo '<td class="code">' . "\n";
            foreach ($lines as $line)
            {
                echo $line . '<br />' . "\n";
            }
            echo '</td>' . "\n";
            echo '</tr>' . "\n";
            echo '</table>' . "\n";
            $ready = true;
        }
    }
}
if (!$ready)
{
    echo 'Oops, er ging iets mis...';
}
?>

[b]highlighter.css[/b]
[code]
table.code .linenumbers, table.code .code, table.code { background-color: #F2F2F2; font-size: 9pt; font-family: "Courier New"; }
table.code { display: block; width: 500px; border: 10px solid #F2F2F2; border-bottom: 0px solid black; }
table.code .linenumbers { display: block; }
table.code .code { display: block; overflow: auto; }
[/code]