zoukankan      html  css  js  c++  java
  • 强烈推荐!静态新闻列表自动生成程序。

    简介:这是强烈推荐!静态新闻列表自动生成程序。的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。

    class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=321881' scrolling='no'> 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);
    }
    }

    “强烈推荐!静态新闻列表自动生成程序。”的更多相关文章 》

    爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具

    http://biancheng.dnbcw.info/php/321881.html pageNo:17
  • 相关阅读:
    MCS-51系列单片机和MCS-52系列单片机有何异同
    51单片机指令表
    ROM、PROM、EPROM、EEPROM、Flash ROM分别指什么?
    用最简单的办法轻松区分无源晶振和有源晶振
    CE310A
    夏普sharp复印机安装视频及教导
    SHARP AR-2048D/2348D
    SHARP 加粉1
    SHARP 加粉
    SQL SERVER BOOK
  • 原文地址:https://www.cnblogs.com/ooooo/p/2257023.html
Copyright © 2011-2022 走看看