1
0
mirror of https://github.com/php/web-php.git synced 2026-03-28 09:12:17 +01:00
Files
archived-web-php/show_source.php3
Stig Bakken 6bc2dc59c2 there.
1998-01-26 08:19:32 +00:00

29 lines
643 B
PHP

<? isset($page_url) or die("No page URL specified."); ?>
<html>
<head>
<title>Source of <? echo $page_url ?></title>
<?
$title="Source of $page_url";
include "include/header.inc";
/* 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);
include "include/footer.inc";
?>