Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Show source

  • file_get_contents
  • htmlspecialchars
<a href="source.php">source</a><p>
<?php
$html = "";
$file = $_GET['file'];
if (strcmp($file, "") == 0) {
    $file = $_SERVER['HTTP_REFERER'];
    ereg("([^/]*$)", $file, $res);
    $file = $res[0];
}
if (strcmp($file, "") == 0) {
    print "Filename missing";
} else {
    $html = file_get_contents($file);
    print htmlspecialchars($html);
}
?>