All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
使用ASP.NET,2.0,DetailsView控件处理数据_[Asp.Net教程]
在asp.net2.0页面部分缓存中使用@ OutputCache指令
Delphi格式输入组件(TMaskEdit)使用实例
ASP.NET,2.0中XSLT的使用_[Asp.Net教程]
怎样在vb.net中将图片存入SQL,Server,2000并能读出来使用
SQL Server中如何用通配符搜索TEXT栏_[SQL Server教程]
PHP项目将联合起来转向PHP5_php资料_编程技术
详细介绍PHP动态网页技术中SESSION的应用_php资料_编程技术
ASP.NET技巧:配置.net,3.0开发环境_.net资料_编程技术
asp.net2.0实现邮件发送(成功测试)_[Asp.Net教程]
Reading number is top 10 pictures
The terra-cotta warriors2
毕姥爷事件,告诉你6条真理
Summer is most suitable for young people to travel in China2
Beautiful vacuum girl2
世界五大海盗
西班牙山村小景3
Send some Valentine's day cartoon
乳娘帕梅拉安德森4
In the world the most mysterious 21 place landscape1
两张抽象画
Download software ranking
都市狐狸姑娘传
Photoshop 8.0图象编辑软件
Boxer's Top ten classic battle9
C语言教程TXT
Unix video tutorial19
Visual C++界面编程技术
The Bermuda triangle3
Twenty piece of palm leaf
jBuilder2006
linux高级编程
aaa published in(发表于) 2013/12/27 19:52:37 Edit(编辑)
PHP动态网页实现静态HTML技术的方法实现_php资料_编程技术

PHP动态网页实现静态HTML技术的方法实现_php资料_编程技术

PHP动态网页实现静态HTML技术的方法实现_php资料_编程技术-你的首页-uuhomepage.com


/*____生成HTML文件________beign__________*/
if ($make_html)
{
$buffer = ob_get_flush();
if ($go_html)//是否直接转到HTML文件显示还是PHP读得内容输出(0:php读内容输出1:直接转)
{
/*__处理因生成了HTML文件而产生的种径问题______begin_______*/
$search = array(
"/(src=|action=|href=|ajaxRead\()\"/ie",
"/\.\.\./e",
"/\.\/\./e",
"/\.\.\/http:\/\//ies",
"/\.\.\/#/",
"/\'\.\'/e",
"/\.\.\/javascript:/ies");

$replace = array(
"'\\1\"../'",
"'..'",
"'.'",
"'http://'",
"#",
"'\'..\''",
"'javascript:'");
$buffer = preg_replace($search, $replace, $buffer);
/*___处理因生成了HTML文件而产生的种径问题_____end_____*/
}

$fp = fopen(HTML_FILE, "w");
if ($fp)
{
fwrite($fp, $buffer);
fclose($fp);
}
}
/*_______生成HTML文件_________beign________*/
?>

ob_start();
/*____判断是否已生成了HTML文件,若生成了则跳转到HTML页面___begin_____*/
$qstring = isset($_SERVER["QUERY_STRING"]) ? $_SERVER["QUERY_STRING"] : "";
if ($qstring)//程序加了GET请求的处理
{
$qstring = str_replace("=", "", $qstring);
define("HTML_FILE", "./h/{$efilename}-{$qstring}.html");
}
else
{
define("HTML_FILE", "./h/{$efilename}.html");
}
if (file_exists(HTML_FILE))
{
$lcft = filemtime(HTML_FILE);//last create file time
if (($lcft + 3600) > time())//判断上次生成HTML文件是否以过去1时间,若没有才直接输出文件内容
{
if ($show_html)//是否以HTML静态页面展示(0不以HTML展显1以html展显)
{
if ($go_html)//是否直接转到HTML文件显示还是PHP读得内容输出(0:php读内容输出1:直接转)
{
header("Location: " . HTML_FILE);//直接转
}
else
{
echo(file_get_contents(HTML_FILE));//读出展显
}
exit(0);
}
}
}
/*___判断是否已生成了HTML文件,若生成了则跳转到HTML页面_____end_____*/
?>

require("woods-thtml.php");//生成HTML处理头
//if (count($_GET) < 1 && count($_POST) < 1){require("woods-thtml.php");}//生成HTML处理头

require("{$exec_file}");//注册语言定义文件
foreach ($lang as $key => $value)
{
$atpl[strtoupper($key) ."_LANG"] = $value;
}
/*__________列表常识向上走的项_______end_______*/
include("woods-templates.php");
$tpl = new WoodsTpl("./templates/");
$tpl->require_tpl("header.html");
$tpl->set_file();
$tpl->block("EBCORP", $scorp);
$tpl->block("NEWS", $news);

$tpl->block("PRODUCT", $product);
$tpl->block("EBPNAME_MSG", $spname);

$tpl->block("LORE", $lore);
$tpl->require_tpl("footer.html");
$tpl->parse($atpl, true);
$tpl = NULL;
/*_____模板操作________end_____________*/
require("woods-bhtml.php");//生成HTML处理尾
?>





添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.