当前位置: 编程技术>php
本页文章导读:
▪main.php
<?php /** * Site Main Page * * @author Avenger <avenger@php.net> * @version $Id 2003-04-11 18:06:20 $ */ require_once 'header.inc.php'; tpl_load("index.html",'','keep'); // Get u language $.........
▪global.php
<?php /** * 自动判断PHP版本,并把所有环境变量转为全局变量 * * @author Avenger <avenger@php.net> * @version $Id 2003-05-18 13:01:14 $ */ function pmyoutput(&$a) { if (is_array($a)).........
▪source.php查看源文件
<?php /** * Show Source * * @author Avenger <avenger@php.net> * @version $Id 2003-07-10 9:09:03 $ */ require_once 'header.inc.php'; tpl_load('left.tpl'); // Check url value if (!isset($_GET['file'])) { .........
[1]main.php
来源: 互联网 发布时间: 2013-11-30
<?php
/**
* Site Main Page
*
* @author Avenger <avenger@php.net>
* @version $Id 2003-04-11 18:06:20 $
*/
require_once 'header.inc.php';
tpl_load("index.html",'','keep');
// Get u language
$G_lang = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
switch ($G_lang[0]) {
case 'zh-hk':
case 'zh-tw':
case 'zh-mo':
case 'zh-cn':
include('lang.zh.inc.php');
$indexfile = 'main_zh.htm';
break;
default:
include('lang.en.inc.php');
$indexfile = 'main_en.htm';
}
$filedate = (int)date(time()-@filemtime($indexfile));
// If lastupdate less than five hours then update
if ($filedate<18000 && filesize($indexfile)<>0 && empty($_GET['update'])) {
require($indexfile);
exit();
} else {
// Rand title
require_once 'titles.inc.php';
$currdate = date('md');
if ($title_h[$currdate]) {
$title_more = $title_h[$currdate];
} else {
$title_more = $title_o[array_rand($title_o)];
}
// Import template
$tpl->setVar("FILEHEAD",file_head());
/*
$tpl->setVar("FILEPIC",file_pic('phptshirt.gif','国内首款 PHP T-shirt 火热预定中……','http://www.phpe.net/t-shirt'));
$tpl->setVar("FILEPIC",file_pic('phpandmore.gif','《PHP&More》创刊号发布','http://www.phpe.net/news/34.shtml'));
$tpl->setVar("FILEPIC",file_pic('3.jpg','超越PHP欢迎您',''));
$tpl->setVar("FILEPIC",file_pic('show.gif','Show出你的热情活动 -- 点击查看详情','http://www.phpe.net/club/index.php?act=ST&f=2&t=1416'));
$tpl->setVar("FILEPIC",file_pic('1year.gif','超越PHP一岁了','http://www.phpe.net/club/index.php?s=&act=ST&f=7&t=2419'));
*/
$tpl->setVar("CREATE",date('Y-m-d H:i:s'));
$tpl->setVar("DESC",$lang['sitedesc']);
$tpl->setVar("KEYWORDS",$lang['sitekeywork']);
$tpl->setVar("TITLE",$lang['sitetitle'].$title_more);
/*
DBInit();
extract($dbinfo,EXTR_OVERWRITE);
$rs = $dbconn->Execute('SHOW TABLES');
while ($result = $rs->FetchRow()) $tables .= $result["Tables_in_$dbname"].",";
$SQL = 'OPTIMIZE TABLE '.substr($tables,0,-1);
$dbconn->Execute($SQL);
*/
$indexlogin = '<script type="text/javascript" language="Javascript" src="/blog_article/user_login.html"></script>';
$tpl->setVar("INDEXLOGIN",$indexlogin);
$space = '<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td><img src="/blog_article/images/spacer.gif" width="1" height="10" alt=""></td></tr></table>';
ob_start();
//echo item_title($lang['stat'],'98%');
include("index_stat.inc.php");
$tpl->setVar("INDEXCOUNT",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['vote'],'98%');
include("index_vote.inc.php");
$tpl->setVar("INDEXVOTE",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['links'],'98%');
include("index_links.inc.php");
$tpl->setVar("INDEXLINK",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['intro'],'98%');
include("index_intro.inc.php");
$tpl->setVar("INDEXINTRO",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['news'].' '.make_link('/?n=RSS&t=news', '(rss)', '_blank', ''),'98%');
include("index_news.inc.php");
$tpl->setVar("INDEXNEW",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['articles'].' '.make_link('/?n=RSS&t=articles', '(rss)', '_blank', ''),'98%');
include("index_article.inc.php");
$tpl->setVar("INDEXARTICLE",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['recommendtopic'],'98%');
echo '
<table width="98%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<script language="Javascript" type="text/javascript" src="'. $Global['bbs'] .'recommend_topic.php?cid=2,6,15,16,18"></script>
</td></tr>
<tr><td bgcolor="#DDDDDD" align="right"><a href="'. $Global['bbs'] .'" title="More...">更多推荐话题 ...</a> </td></tr>
</table>
';
$tpl->setVar("RECOMMENDTOPIC", ob_get_contents());
ob_end_clean();
ob_start();
echo '
<table width="98%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<script language="Javascript" type="text/javascript" src="'. $Global['bbs'] .'recommend_topic.php?cid=13"></script>
</td></tr>
<tr><td bgcolor="#DDDDDD" align="right"><a href="'. $Global['bbs'] .'index.php?s=&act=SF&f=13" title="More...">更多招聘信息 ...</a> </td></tr>
</table>
';
$tpl->setVar("HRTOPIC", ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['faqs'].' '.make_link('/?n=RSS&t=faqs', '(rss)', '_blank', ''),'98%');
include("index_faq.inc.php");
$tpl->setVar("INDEXFAQ",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['nav'],'98%');
include("index_sitenav.inc.php");
$tpl->setVar("INDEXNAV",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['tips'],'98%');
include("index_tips.inc.php");
$tpl->setVar("INDEXTIPS",ob_get_contents());
ob_end_clean();
/*
ob_start();
echo item_title($lang['events'],'98%');
$tpl->setVar("INDEXEVENTS",ob_get_contents());
ob_end_clean();
*/
ob_start();
//echo item_title($lang['resouce'],'98%');
include("index_resource.inc.php");
$tpl->setVar("INDEXRESOURCE",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['souwang'],'98%');
echo '
<form action="/search.html" method="get" target="_blank">
互联网上的 php 资源<br>
<input type="text" size="20" value="php" name="q">
<input type="submit" value="souwang" >
</form>
';
$tpl->setVar("INDEXSOUWANG",ob_get_contents());
ob_end_clean();
//$tpl->setVar("INDEXPARTNERS",item_title($lang['partners'],'98%'));
ob_start();
//echo item_title($lang['calendar'],'98%');
include_once "calendar.inc.php";
$c = new Calendar;
echo $c->getCurrentmonthView();
$tpl->setVar("INDEXCALENDAR",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['newtopic'],'98%');
echo '
<table width="95%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<script language="Javascript" type="text/javascript" src="'. $Global['bbs'] .'new_topic.php?cid=2,6,15,16,18"></script>
</td></tr>
</table>
';
$tpl->setVar("INDEXFORUM", ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['maillist'],'98%');
echo '
<table>
<tr>
<td align="center">
<form method="post" action="/n/Maillist.html">
<font >Join the mail list:</font>
<input name="m" type="text" size="20" maxlength="100" title="加入邮件列表" value="Enter your mail" onFocus="if(this.value==\'Enter your mail\')this.value=\'\';" onBlur="if(this.value==\'\')this.value=\'Enter your mail\';"><br>
<input type="submit" value="Submit" >
</form>
</td>
</tr>
</table>
';
$tpl->setVar("INDEXMAIL",ob_get_contents());
ob_end_clean();
// My name :)
$s_name='index.php';
$tpl->setVar("SPACE",$space);
$tpl->setVar("FILEFOOT",file_foot());
$tpl->parse('output','main');
$output = $tpl->get("output");
// Rwrite to file
wfile($indexfile,$output);
require($indexfile);
}
?>
/**
* Site Main Page
*
* @author Avenger <avenger@php.net>
* @version $Id 2003-04-11 18:06:20 $
*/
require_once 'header.inc.php';
tpl_load("index.html",'','keep');
// Get u language
$G_lang = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
switch ($G_lang[0]) {
case 'zh-hk':
case 'zh-tw':
case 'zh-mo':
case 'zh-cn':
include('lang.zh.inc.php');
$indexfile = 'main_zh.htm';
break;
default:
include('lang.en.inc.php');
$indexfile = 'main_en.htm';
}
$filedate = (int)date(time()-@filemtime($indexfile));
// If lastupdate less than five hours then update
if ($filedate<18000 && filesize($indexfile)<>0 && empty($_GET['update'])) {
require($indexfile);
exit();
} else {
// Rand title
require_once 'titles.inc.php';
$currdate = date('md');
if ($title_h[$currdate]) {
$title_more = $title_h[$currdate];
} else {
$title_more = $title_o[array_rand($title_o)];
}
// Import template
$tpl->setVar("FILEHEAD",file_head());
/*
$tpl->setVar("FILEPIC",file_pic('phptshirt.gif','国内首款 PHP T-shirt 火热预定中……','http://www.phpe.net/t-shirt'));
$tpl->setVar("FILEPIC",file_pic('phpandmore.gif','《PHP&More》创刊号发布','http://www.phpe.net/news/34.shtml'));
$tpl->setVar("FILEPIC",file_pic('3.jpg','超越PHP欢迎您',''));
$tpl->setVar("FILEPIC",file_pic('show.gif','Show出你的热情活动 -- 点击查看详情','http://www.phpe.net/club/index.php?act=ST&f=2&t=1416'));
$tpl->setVar("FILEPIC",file_pic('1year.gif','超越PHP一岁了','http://www.phpe.net/club/index.php?s=&act=ST&f=7&t=2419'));
*/
$tpl->setVar("CREATE",date('Y-m-d H:i:s'));
$tpl->setVar("DESC",$lang['sitedesc']);
$tpl->setVar("KEYWORDS",$lang['sitekeywork']);
$tpl->setVar("TITLE",$lang['sitetitle'].$title_more);
/*
DBInit();
extract($dbinfo,EXTR_OVERWRITE);
$rs = $dbconn->Execute('SHOW TABLES');
while ($result = $rs->FetchRow()) $tables .= $result["Tables_in_$dbname"].",";
$SQL = 'OPTIMIZE TABLE '.substr($tables,0,-1);
$dbconn->Execute($SQL);
*/
$indexlogin = '<script type="text/javascript" language="Javascript" src="/blog_article/user_login.html"></script>';
$tpl->setVar("INDEXLOGIN",$indexlogin);
$space = '<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td><img src="/blog_article/images/spacer.gif" width="1" height="10" alt=""></td></tr></table>';
ob_start();
//echo item_title($lang['stat'],'98%');
include("index_stat.inc.php");
$tpl->setVar("INDEXCOUNT",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['vote'],'98%');
include("index_vote.inc.php");
$tpl->setVar("INDEXVOTE",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['links'],'98%');
include("index_links.inc.php");
$tpl->setVar("INDEXLINK",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['intro'],'98%');
include("index_intro.inc.php");
$tpl->setVar("INDEXINTRO",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['news'].' '.make_link('/?n=RSS&t=news', '(rss)', '_blank', ''),'98%');
include("index_news.inc.php");
$tpl->setVar("INDEXNEW",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['articles'].' '.make_link('/?n=RSS&t=articles', '(rss)', '_blank', ''),'98%');
include("index_article.inc.php");
$tpl->setVar("INDEXARTICLE",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['recommendtopic'],'98%');
echo '
<table width="98%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<script language="Javascript" type="text/javascript" src="'. $Global['bbs'] .'recommend_topic.php?cid=2,6,15,16,18"></script>
</td></tr>
<tr><td bgcolor="#DDDDDD" align="right"><a href="'. $Global['bbs'] .'" title="More...">更多推荐话题 ...</a> </td></tr>
</table>
';
$tpl->setVar("RECOMMENDTOPIC", ob_get_contents());
ob_end_clean();
ob_start();
echo '
<table width="98%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<script language="Javascript" type="text/javascript" src="'. $Global['bbs'] .'recommend_topic.php?cid=13"></script>
</td></tr>
<tr><td bgcolor="#DDDDDD" align="right"><a href="'. $Global['bbs'] .'index.php?s=&act=SF&f=13" title="More...">更多招聘信息 ...</a> </td></tr>
</table>
';
$tpl->setVar("HRTOPIC", ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['faqs'].' '.make_link('/?n=RSS&t=faqs', '(rss)', '_blank', ''),'98%');
include("index_faq.inc.php");
$tpl->setVar("INDEXFAQ",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['nav'],'98%');
include("index_sitenav.inc.php");
$tpl->setVar("INDEXNAV",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['tips'],'98%');
include("index_tips.inc.php");
$tpl->setVar("INDEXTIPS",ob_get_contents());
ob_end_clean();
/*
ob_start();
echo item_title($lang['events'],'98%');
$tpl->setVar("INDEXEVENTS",ob_get_contents());
ob_end_clean();
*/
ob_start();
//echo item_title($lang['resouce'],'98%');
include("index_resource.inc.php");
$tpl->setVar("INDEXRESOURCE",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['souwang'],'98%');
echo '
<form action="/search.html" method="get" target="_blank">
互联网上的 php 资源<br>
<input type="text" size="20" value="php" name="q">
<input type="submit" value="souwang" >
</form>
';
$tpl->setVar("INDEXSOUWANG",ob_get_contents());
ob_end_clean();
//$tpl->setVar("INDEXPARTNERS",item_title($lang['partners'],'98%'));
ob_start();
//echo item_title($lang['calendar'],'98%');
include_once "calendar.inc.php";
$c = new Calendar;
echo $c->getCurrentmonthView();
$tpl->setVar("INDEXCALENDAR",ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['newtopic'],'98%');
echo '
<table width="95%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<script language="Javascript" type="text/javascript" src="'. $Global['bbs'] .'new_topic.php?cid=2,6,15,16,18"></script>
</td></tr>
</table>
';
$tpl->setVar("INDEXFORUM", ob_get_contents());
ob_end_clean();
ob_start();
//echo item_title($lang['maillist'],'98%');
echo '
<table>
<tr>
<td align="center">
<form method="post" action="/n/Maillist.html">
<font >Join the mail list:</font>
<input name="m" type="text" size="20" maxlength="100" title="加入邮件列表" value="Enter your mail" onFocus="if(this.value==\'Enter your mail\')this.value=\'\';" onBlur="if(this.value==\'\')this.value=\'Enter your mail\';"><br>
<input type="submit" value="Submit" >
</form>
</td>
</tr>
</table>
';
$tpl->setVar("INDEXMAIL",ob_get_contents());
ob_end_clean();
// My name :)
$s_name='index.php';
$tpl->setVar("SPACE",$space);
$tpl->setVar("FILEFOOT",file_foot());
$tpl->parse('output','main');
$output = $tpl->get("output");
// Rwrite to file
wfile($indexfile,$output);
require($indexfile);
}
?>
[2]global.php
来源: 互联网 发布时间: 2013-11-30
<?php
/**
* 自动判断PHP版本,并把所有环境变量转为全局变量
*
* @author Avenger <avenger@php.net>
* @version $Id 2003-05-18 13:01:14 $
*/
function pmyoutput(&$a) {
if (is_array($a)) {
array_walk($a,'pmyoutput');
} else {
$a = stripslashes($a);
$a = str_replace('"', '"', $a);
}
}
function pmyinput(&$a) {
if (is_array($a)) {
array_walk($a,'pmyinput');
} else {
$a = addslashes($a);
}
}
/*
if (phpversion() < '4.1.0') {
isset($HTTP_SESSION_VARS) ? $GLOBALS['_SESSION'] = &$HTTP_SESSION_VARS : '';
isset($HTTP_SERVER_VARS) ? $GLOBALS['_SERVER'] = &$HTTP_SERVER_VARS : '';
isset($HTTP_ENV_VARS) ? $GLOBALS['_ENV'] = &$HTTP_ENV_VARS : '';
isset($HTTP_FILES_VARS) ? $GLOBALS['_FILES'] = &$HTTP_FILES_VARS : '';
if (get_magic_quotes_gpc() == 1) {
isset($HTTP_GET_VARS) ? $GLOBALS['_GET'] = &$HTTP_GET_VARS : '';
isset($HTTP_POST_VARS) ? $GLOBALS['_POST'] = &$HTTP_POST_VARS : '';
isset($HTTP_COOKIE_VARS) ? $GLOBALS['_COOKIE'] = &$HTTP_COOKIE_VARS : '';
} else {
isset($HTTP_GET_VARS) ? pmyinput($HTTP_GET_VARS) : '';
isset($HTTP_POST_VARS) ? pmyinput($HTTP_POST_VARS) : '';
isset($HTTP_COOKIE_VARS) ? pmyinput($HTTP_COOKIE_VARS) : '';
$GLOBALS['_GET'] = &$HTTP_GET_VARS;
$GLOBALS['_POST'] = &$HTTP_POST_VARS;
$GLOBALS['_COOKIE'] = &$HTTP_COOKIE_VARS;
}
$GLOBALS['_REQUEST'] = array_merge($_GET, $_POST, $_COOKIE);
} else {
if (get_magic_quotes_gpc() != 1) {
isset($_GET) ? pmyinput($_GET) : '';
isset($_POST) ? pmyinput($_POST) : '';
isset($_COOKIE) ? pmyinput($_COOKIE) : '';
isset($_REQUEST) ? pmyinput($_REQUEST) : '';
}
}
*/
?>
/**
* 自动判断PHP版本,并把所有环境变量转为全局变量
*
* @author Avenger <avenger@php.net>
* @version $Id 2003-05-18 13:01:14 $
*/
function pmyoutput(&$a) {
if (is_array($a)) {
array_walk($a,'pmyoutput');
} else {
$a = stripslashes($a);
$a = str_replace('"', '"', $a);
}
}
function pmyinput(&$a) {
if (is_array($a)) {
array_walk($a,'pmyinput');
} else {
$a = addslashes($a);
}
}
/*
if (phpversion() < '4.1.0') {
isset($HTTP_SESSION_VARS) ? $GLOBALS['_SESSION'] = &$HTTP_SESSION_VARS : '';
isset($HTTP_SERVER_VARS) ? $GLOBALS['_SERVER'] = &$HTTP_SERVER_VARS : '';
isset($HTTP_ENV_VARS) ? $GLOBALS['_ENV'] = &$HTTP_ENV_VARS : '';
isset($HTTP_FILES_VARS) ? $GLOBALS['_FILES'] = &$HTTP_FILES_VARS : '';
if (get_magic_quotes_gpc() == 1) {
isset($HTTP_GET_VARS) ? $GLOBALS['_GET'] = &$HTTP_GET_VARS : '';
isset($HTTP_POST_VARS) ? $GLOBALS['_POST'] = &$HTTP_POST_VARS : '';
isset($HTTP_COOKIE_VARS) ? $GLOBALS['_COOKIE'] = &$HTTP_COOKIE_VARS : '';
} else {
isset($HTTP_GET_VARS) ? pmyinput($HTTP_GET_VARS) : '';
isset($HTTP_POST_VARS) ? pmyinput($HTTP_POST_VARS) : '';
isset($HTTP_COOKIE_VARS) ? pmyinput($HTTP_COOKIE_VARS) : '';
$GLOBALS['_GET'] = &$HTTP_GET_VARS;
$GLOBALS['_POST'] = &$HTTP_POST_VARS;
$GLOBALS['_COOKIE'] = &$HTTP_COOKIE_VARS;
}
$GLOBALS['_REQUEST'] = array_merge($_GET, $_POST, $_COOKIE);
} else {
if (get_magic_quotes_gpc() != 1) {
isset($_GET) ? pmyinput($_GET) : '';
isset($_POST) ? pmyinput($_POST) : '';
isset($_COOKIE) ? pmyinput($_COOKIE) : '';
isset($_REQUEST) ? pmyinput($_REQUEST) : '';
}
}
*/
?>
[3]source.php查看源文件
来源: 互联网 发布时间: 2013-11-30
<?php
/**
* Show Source
*
* @author Avenger <avenger@php.net>
* @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 = "<h4>Source of: /".htmlentities($url)."</h4><hr size=1>";
// If this is a legal dir, then it is 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 .= "<!-- ".htmlentities($page_name)." -->\n<code>";
$body .= highlight_file($page_name,true);
$body .= "</code>\n<br><hr size=1><br><br>\n";
} else {
$body .= "<table border='0'><tr><td><img hspace='5' vspace='5' src='/images/page.gif' width='25' height='33' border='0' alt=''></td><td valign='bottom'><h4>该文件不存在!</h4></td></tr></table><hr size=1><font >Exceed PHP was unable to link to the Page you requested. The page might be temporarily unavailable.</font>\n";
}
}
$left_1 = ' "Open Source"(开放源码)被非赢利软件组织(美国的Open Source Initiative协会)注册为认证标记,并对其进行了正式的定义,用于描述那些源码可以被公众使用的软件,并且此软件的使用、修改和发行也不受许可证的限制。开放源码软件通常是有版权 ( copyright ) 的 ...<div align="right">[<a href="/n/ShowFaq/amp;a/9.html" >more...</a>]<div>';
$left_2 = '
这里是站点所用到的一些公共文件:
<ul>
<li><a href="/n/Source/amp;file/main.php.html">main.php</a></li>
<li><a href="/n/Source/amp;file/header.inc.php.html">header.inc.php</a></li>
<li><a href="/n/Source/amp;file/inc/global.php.html">global.php</a></li>
<li><a href="/n/Source/amp;file/inc/function.inc.php.html">function.inc.php</a></li>
<li><a href="/n/Source/amp;file/inc/layerout.inc.php.html">layerout.inc.php</a></li>
<li><a href="/n/Source/amp;file/inc/calendar.inc.php.html">calendar.inc.php</a></li>
</ul>
<a href="/n/Source/amp;file/source.php.html">source.php文件本身。</a>
<br><br>
';
// 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' => '关于 Open Source',
'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","Show source - ".htmlentities($url));
$tpl->setVar("DESC","开放源码,Show source,PHP");
$tpl->setVar("KEYWORDS","开放源码,Show source,PHP");
$tpl->setVar("BAR",'');
$tpl->setVar("BODY",$body);
$tpl->setVar("FILEFOOT",file_foot());
tpl_output();
?>
/**
* Show Source
*
* @author Avenger <avenger@php.net>
* @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 = "<h4>Source of: /".htmlentities($url)."</h4><hr size=1>";
// If this is a legal dir, then it is 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 .= "<!-- ".htmlentities($page_name)." -->\n<code>";
$body .= highlight_file($page_name,true);
$body .= "</code>\n<br><hr size=1><br><br>\n";
} else {
$body .= "<table border='0'><tr><td><img hspace='5' vspace='5' src='/images/page.gif' width='25' height='33' border='0' alt=''></td><td valign='bottom'><h4>该文件不存在!</h4></td></tr></table><hr size=1><font >Exceed PHP was unable to link to the Page you requested. The page might be temporarily unavailable.</font>\n";
}
}
$left_1 = ' "Open Source"(开放源码)被非赢利软件组织(美国的Open Source Initiative协会)注册为认证标记,并对其进行了正式的定义,用于描述那些源码可以被公众使用的软件,并且此软件的使用、修改和发行也不受许可证的限制。开放源码软件通常是有版权 ( copyright ) 的 ...<div align="right">[<a href="/n/ShowFaq/amp;a/9.html" >more...</a>]<div>';
$left_2 = '
这里是站点所用到的一些公共文件:
<ul>
<li><a href="/n/Source/amp;file/main.php.html">main.php</a></li>
<li><a href="/n/Source/amp;file/header.inc.php.html">header.inc.php</a></li>
<li><a href="/n/Source/amp;file/inc/global.php.html">global.php</a></li>
<li><a href="/n/Source/amp;file/inc/function.inc.php.html">function.inc.php</a></li>
<li><a href="/n/Source/amp;file/inc/layerout.inc.php.html">layerout.inc.php</a></li>
<li><a href="/n/Source/amp;file/inc/calendar.inc.php.html">calendar.inc.php</a></li>
</ul>
<a href="/n/Source/amp;file/source.php.html">source.php文件本身。</a>
<br><br>
';
// 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' => '关于 Open Source',
'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","Show source - ".htmlentities($url));
$tpl->setVar("DESC","开放源码,Show source,PHP");
$tpl->setVar("KEYWORDS","开放源码,Show source,PHP");
$tpl->setVar("BAR",'');
$tpl->setVar("BODY",$body);
$tpl->setVar("FILEFOOT",file_foot());
tpl_output();
?>
最新技术文章: