|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
PHP代码:-------------------------------------------------------------------------------- /* 版权所有:日出东方XP 2004.7.17 */ function CreateShtml() { ob_start(array("callback_CreateShtml","callback_GoToShtml")); } function callback_CreateShtml($buffer) { $page = intval(@$_REQUEST["page"]); $fileName = $_SERVER[\\'DOCUMENT_ROOT\\'] . dirname($_SERVER[\\'PHP_SELF\\']) . "/" . basename($_SERVER[\\'PHP_SELF\\'],".php") . ($page==0 ? "" : "_" . strval($page)) . ".htm"; $fp = fopen($fileName,"wb"); fwrite($fp,$buffer); fclose($fp); return $buffer; } function callback_GoToShtml($buffer) { $page = intval(@$_REQUEST["page"]); $fileName = basename($_SERVER[\\'PHP_SELF\\'],".php") . ($page==0 ? "" : "_" . strval($page)) . ".htm"; header("location:" . $fileName); return $buffer; } function GoToShtml() { $page = intval(@$_REQUEST["page"]); $fileName = basename($_SERVER[\\'PHP_SELF\\'],".php") . ($page==0 ? "" : "_" . strval($page)) . ".htm"; if(file_exists($fileName)) header("location:" . $fileName); } function DeleteShtml($fileName=NULL) { if(is_null($fileName)) $fileName = $_SERVER[\\'DOCUMENT_ROOT\\'] . $_SERVER[\\'PHP_SELF\\']; if($fileName[0]=="/") $fileName = $_SERVER[\\'DOCUMENT_ROOT\\'] . $fileName; $path = dirname($fileName); $dir = dir($path); $patten = "/^" . basename($fileName, ".php") . "(_[0-9]+)?.htm/"; while(($entry = $dir->read())!==false) { if(is_file($path . "/" .$entry) && preg_match($patten,$entry)) unlink ($path . "/" . $entry); } } 返回类别: 教程 上一教程: PHP中重新定向到另一个页面 下一教程: PHP的面向对象编程:开发大型PHP项目的方式(一) 您可以阅读与"强烈推荐! 静态新闻列表自动生成程序"相关的教程: · 强烈推荐! 静态新闻列表自动生成程序。 · 自动生成静态页面 · 福利彩票幸运号码自动生成器 · PHP和.NET版客户端信息自动生成 · PHP设计福利彩票幸运号码自动生成器 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |