1
0
mirror of https://github.com/php/web-php.git synced 2026-03-28 17:22:06 +01:00
Files
archived-web-php/new/source.php3
Colin Viebrock 14653a7fca A few more tweaks:
- When you view source on any page, you get a close button to go back to the previous page
- tweaked layout of manual
1998-02-24 16:59:02 +00:00

32 lines
663 B
PHP

<?
require("shared.inc");
commonHeader("Show Source");
if (!isset($page_url)):
echo "No page URL specified.";
commonFooter();
exit;
endif;
echo "Source of: $page_url<BR><hr noshade><FONT SIZE=-1>\n";
/* remove other path prefixes than /manual/ */
$legal_paths = array("/manual" => 1);
$tmp = strrchr($page_url, "/");
if ($tmp) {
$path = substr($page_url, 0, strlen($page_url)-strlen($tmp));
if ($legal_paths[$path]) {
$page_name = "$DOCUMENT_ROOT/" . ereg_replace("^/", "", $page_url);
} else {
$page_name = substr($tmp, 1, strlen($tmp));
}
} else {
$page_name = $page_url;
}
show_source($page_name);
commonFooter();
?>