/**
* Show Source
*
* @author Avenger
* @version $Id 2003-07-10 9:09:03 $
*/
Require_once ' header.inc.php ';
Tpl_load (' Left.tpl ');
Check URL Value
if (!isset ($_get[' file ')) {
$body = "No page URL specified.";
} else {
Fix the security hole, thx for jun_test#hotmail.com
$url = Str_replace ('.. ', ' ', $_get[' file ');
if (file_exists ($url)) {
$body = "
Source of:/". Htmlentities ($url)."
";
If This was a legal dir, then it was under the docroot, else use basename
if (dirname ($url)) {
$page _name = $Global [' Path ']. /$url ";
} else {
$page _name = basename ($url);
}
if (Strpos ($page _name, ' header.inc.php ') | | $page _name== ' header.inc.php ') {$page _name= ' Header.inc.bak ';}
if (Strpos ($page _name, ' config.php ') | | $page _name== ' config.php ') {$page _name= ' My/config.php.bak ';}
$body. = " \ n
";
$body .= highlight_file($page_name,true);
$body .= "\ n
\ n ";
} else {
$body. = "
Exceed PHP was unable to link to the Page you requested. The page might be temporarily unavailable.\n ";
}
}
The $left _1 = ' open source ' (open source) is registered as a certification mark by the non-profit software organization (Open Source Initiative Association of the United States) and is formally defined to describe the software that the source code can be used by the public, and the use of the software, Modifications and distributions are also not subject to license restrictions. Open source software is usually copyrighted ... [More ...] ';
$left _2 = '
Here are some of the common files used by the site:
- main.php
- header.inc.php
- global.php
- function.inc.php
- layerout.inc.php
- calendar.inc.php
The source.php file itself.
';
My name:)
$s _name = ' source.php ';
Import template NOW!!!
$TPL->setfile ("main", "Left.tpl");
Import Block
$TPL->setblock ("main", "Aleft", "left1");
$tpl->setvar (
Array
' Ltitle ' = ' about Open Source ',
' Left ' = $left _1,
));
$tpl->parse (' left1 ', ' Aleft ', true);
$tpl->setvar (
Array
' Ltitle ' = ' other page code ',
' Left ' = $left _2,
));
$tpl->parse (' left1 ', ' Aleft ', true);
$tpl->setvar ("Filehead", File_head ());
$tpl->setvar ("Filepic", "');
$tpl->setvar ("TITLE", "Show Source-". Htmlentities ($url));
$tpl->setvar ("DESC", "open source, Show source,php");
$tpl->setvar ("KEYWORDS", "open source, Show source,php");
$tpl->setvar ("BAR", ");
$tpl->setvar ("BODY", $body);
$tpl->setvar ("Filefoot", File_foot ());
Tpl_output ();
?>
http://www.bkjia.com/PHPjc/317459.html www.bkjia.com true http://www.bkjia.com/PHPjc/317459.html techarticle ? php/** *showsource * * @authorAvengeravenger @php.net * @version $Id 2003-07-109:09:03$ */require_once ' header. Inc.php '; Tpl_load (' Left.tpl '); Checkurlvalue if (!isset ($_get[' file ')) ...