source.php查看源文件_php教程-查字典教程网
source.php查看源文件
source.php查看源文件
发布时间:2016-12-29 来源:查字典编辑
摘要:

<?php

/**

*ShowSource

*

*@authorAvenger<avenger@php.net>

*@version$Id2003-07-109:09:03$

*/

require_once'header.inc.php';

tpl_load('left.tpl');

//Checkurlvalue

if(!isset($_GET['file'])){

$body="NopageURLspecified.";

}else{

//Fixthesecurityhole,thxforjun_test#hotmail.com

$url=str_replace('..','',$_GET['file']);

if(file_exists($url)){

$body="<h4>Sourceof:/".htmlentities($url)."</h4><hrsize=1>";

//Ifthisisalegaldir,thenitisunderthedocroot,elseusebasename

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<code>";

$body.=highlight_file($page_name,true);

$body.="</code>n<br><hrsize=1><br><br>n";

}else{

$body.="<tableborder='0'><tr><td><imghspace='5'vspace='5'src='/images/page.gif'width='25'height='33'border='0'alt=''></td><tdvalign='bottom'><h4>该文件不存在!</h4></td></tr></table><hrsize=1><font>ExceedPHPwasunabletolinktothePageyourequested.Thepagemightbetemporarilyunavailable.</font>n";

}

}

$left_1='"OpenSource"(开放源码)被非赢利软件组织(美国的OpenSourceInitiative协会)注册为认证标记,并对其进行了正式的定义,用于描述那些源码可以被公众使用的软件,并且此软件的使用、修改和发行也不受许可证的限制。开放源码软件通常是有版权(copyright)的...<divalign="right">[<ahref="/?n=ShowFaq&a=9"class="en1">more...</a>]<div>';

$left_2='

这里是站点所用到的一些公共文件:

<ul>

<li><ahref="/?n=Source&file=main.php">main.php</a></li>

<li><ahref="/?n=Source&file=header.inc.php">header.inc.php</a></li>

<li><ahref="/?n=Source&file=inc/global.php">global.php</a></li>

<li><ahref="/?n=Source&file=inc/function.inc.php">function.inc.php</a></li>

<li><ahref="/?n=Source&file=inc/layerout.inc.php">layerout.inc.php</a></li>

<li><ahref="/?n=Source&file=inc/calendar.inc.php">calendar.inc.php</a></li>

</ul>

<ahref="/?n=Source&file=source.php">source.php文件本身。</a>

<br><br>

';

//Myname:)

$s_name='source.php';

//Importtemplatenow!!!

$tpl->setFile("main","left.tpl");

//Importblock

$tpl->setBlock("main","ALEFT","left1");

$tpl->setVar(

array(

'LTITLE'=>'关于OpenSource',

'LEFT'=>$left_1,

));

$tpl->parse('left1','ALEFT',true);

$tpl->setVar(

array(

'LTITLE'=>'其它页面代码',

'LEFT'=>$left_2,

));

$tpl->parse('left1','ALEFT',true);

$tpl->setVar("FILEHEAD",file_head());

$tpl->setVar("FILEPIC",'');

$tpl->setVar("TITLE","Showsource-".htmlentities($url));

$tpl->setVar("DESC","开放源码,Showsource,PHP");

$tpl->setVar("KEYWORDS","开放源码,Showsource,PHP");

$tpl->setVar("BAR",'');

$tpl->setVar("BODY",$body);

$tpl->setVar("FILEFOOT",file_foot());

tpl_output();

?>

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新php教程学习
    热门php教程学习
    编程开发子分类