zoukankan      html  css  js  c++  java
  • php 如何生成静态页

    PHP文件名:dome.php

    <?php
        $string = 1;
        ob_start();
        @readfile("templets/list.html");
        $text = ob_get_flush();
        $myfile = fopen("list.html","w");
        $text = str_replace ("{counent}",$string,$text);
        fwrite($myfile,$text);
        ob_clean();
        ?>

    模板文件名:templets/list.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    </body>
    <table width="500" border="0" cellpadding="5" cellspacing="1" align="center" bgcolor="#add3ef">
      <tr bgcolor="#eff3ff">
        <td>用户:{counent_user}  标题:{counent_title}  发布时间:{counent_lastdate}</td>
      </tr>
      <tr bgcolor="#fff">
        <td>内容:{counent_content}</td>
      </tr>
    </table>
    </form>
    </html>
  • 相关阅读:
    git常用命令
    代码实现-栈、队列、双端队列
    websocket实现简单的单聊
    websocket实现简单的群聊
    成员
    反射
    类与类之间的关系
    常用模块-02
    模块
    微信小程序表单多页面步骤提交
  • 原文地址:https://www.cnblogs.com/hehe520/p/6147513.html
Copyright © 2011-2022 走看看