<?php error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING); $allowed = array( "plugins_header", "plugins_footer", "index", "admin_login", "scroll_manager", "show_create", "sql_config_example", "viewsource", "quest_timer", "qt_viewquests", "qt_viewtimers", "quest_timer/savequests", "quest_timer/loadquests", "quest_timer/newquests", "quest_timer/submitquests", ); sort($allowed); ?> <html> <head> <title>Show source for <?= $_GET['page'] ?>.php</title> <style> a, a:visited, a:active { font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 0.8em; color: #34475F; } a:hover { color:#EEAC33; } </style> </head> <body> <div style="background-color:#EEECDF; text-align:center;">| <?php foreach($allowed as $page) { echo("<a href='" . $_SERVER['PHP_SELF'] . "?page=$page'>$page.php</a> | "); } ?> </div> <?php $shown = false; foreach($allowed as $page) { if ($_GET['page'] == $page) { echo("<table><tr><td valign='middle'><h1>$page.php</h1></td>"); echo("<td valign='middle'> [<a href='$page.php'>Go to page</a>]</td>"); echo("</tr></table><hr><br>"); echo("<table><tr><td nowrap>"); show_source("$page.php"); echo("</td></tr></table>"); $shown = true; break; } } if (!$shown) { if (!isset($_GET['page'])) echo("<br>Choose a page from above"); else echo("Unable to show source code for $_GET[page].php! Page either doesn't exist or source viewing is not allowed."); } ?>
</body> </html>
|