php简单生成html静态页面代码

$fileName = md5_filename($rs[0],$rs['z_a'],$rs['filesendid']);
   $path = get_path($rs['sysa']).$rs['z_a'].'/';
     
   $parent = $_SERVER["DOCUMENT_ROOT"];//substr(getcwd(),0,strrpos(getcwd(),'\'));  
    
   $filePath = $parent.'\'.$path;
   $tempLate = str_replace('{path}',path($rs['z_a'],$rs['sysa']),$fileContent);
   $tempLate = str_replace('{htmlAbout}',htmlAbout($rs['z_a'],10,8,0,''),$tempLate);   
   $tempLate = str_replace('{htmlTemplate}',htmlTemplate(0),$tempLate);
   $tempLate = str_replace('{htmlMenu}',htmlMenu($rs['sysa']),$tempLate);
   $tempLate = str_replace('{htmlHelp}',htmlHelp($rs['sysa']),$tempLate);
   $tempLate = str_replace('{htmlNews}',htmlAbout($rs['z_a'],0,8,0,''),$tempLate);
   $tempLate = str_replace('{htmlHot}',htmlAbout($rs['z_a'],0,8,1,''),$tempLate);
   $tempLate = str_replace('{htmlSoure}',htmlTemplate(1),$tempLate);
   $tempLate = str_replace('php简单生成html静态页面代码',$rs['title'],$tempLate);
   $tempLate = str_replace('{htmlContent}',$rs['content'],$tempLate);
   $tempLate = str_replace('{description}',$rs['description'],$tempLate);
   $tempLate = str_replace('{keywords}',$rs['keywords'],$tempLate);
   makeHtml($tempLate,$filePath,$fileName);

function makeHtml($msgContent,$filePath,$fileName){//生成html文件  
  if(!is_dir($filePath)){@mkdir($filePath);} 
  //die($filePath);   
  $handle = fopen(str_replace('\','../',$filePath.$fileName),'w+') or die("can't create file!$fileName");
  fwrite($handle,$msgContent);
  fclose($handle);  
}

本站原创转截注明:www.111cn.net/phper/php.html

时间: 2024-07-30 23:08:02

php简单生成html静态页面代码的相关文章

jsp 生成静态页面代码

网页特效phttp://www.111cn.net/网页特效p.html target=_blank >jsp教程 生成静态页面代码 buildhtml.java: import java.util.*; import java.io.*; public class htmlfile{ public static void main(string[] args){ try{ string title="测试"; string content="测试" stri

asp.net生成静态页面代码

asp教程.net生成静态页面代码 private static void createfile(string userid, string filename, string htmlcode)         {             filename += ".html";             string localpath = "e:/www.111cn.net/sun/sundecorativesystem/users/" + userid;    

使用ASP.NET模板生成HTML静态页面的五种方案_实用技巧

ASP.NET模版生成HTML静态页面方案1: 复制代码 代码如下: /// < summary> /// 传入URL返回网页的html代码 /// < /summary> /// < param name="Url">URL< /param> /// < returns>< /returns> public static string getUrltoHtml(string Url) { errorMsg = &

ASP中不用模板生成HTML静态页面的方法_应用技巧

当然是可以的,而且非常简单,今天就教大家在ASP中不用模板生成HTML静态页的方法. 这里假设有一个htmer.asp动态页面,你想把它生成为HTML静态页面htmer.html,那么我们首先新建一个ASP程序文件htmer_to_html.asp(该文件就是用来将htmer.asp动态页面生成为静态页面htmer.html的),htmer_to_html.asp的具体代码如下所示: 复制代码 代码如下: <form method="post" action="&quo

使用PHP实现生成HTML静态页面_php技巧

从PHP生成HTML静态页面并存储到以年份和月份为名称创建的目录. 读取全部数据批量生成,全部生成后弹出提示. 可指定批次生成数量,建议不超过800,否则执行速度会有问题. (出于众所周知的原因,涉及到数据库的数据字段名称做了改动,并且为了代码明晰去掉了参数过滤的部分)  说明:原动态地址为 moban.php?id=1 ,生成后地址为 html/200808/sell_1.html .page.php为分页程序,本博客中有发布. 页面使用方式,将本代码保存为make.php,使用方法为浏览器访

ASP中不用模板生成HTML静态页面的方法

当然是可以的,而且非常简单,今天就教大家在ASP中不用模板生成HTML静态页的方法. 这里假设有一个htmer.asp动态页面,你想把它生成为HTML静态页面htmer.html,那么我们首先新建一个ASP程序文件htmer_to_html.asp(该文件就是用来将htmer.asp动态页面生成为静态页面htmer.html的),htmer_to_html.asp的具体代码如下所示: 复制代码 代码如下: <form method="post" action="&quo

揭露88red生成htm静态页面企业建站系统漏洞第1/2页_漏洞研究

作者:小帥(xsser)@[0.S.T]  本文已发表在<黑客手册>第4期,转载请注明出处,或以超链接方式注明:http://blog.0kee.com/xiaoshuai 小帥's blog 很久没去asp300溜达了,不去总觉得的对不起这个发布站的流量,也对不起黑客手册那么多读者的强烈要求(别扔鸡蛋!扔钱!),那好,既然牛都吹起来了,我不得不冒着生命危险看看代码吧,反正我下载下来的时候就觉得很伟大,这个系统很伟大,他吹的比我还大,好好,我们看他怎么说的:88red生成htm静态页面企业建站

php定时自动生成html静态页面

php定时自动生成html静态页面 "ob_start().ob_end_clean().ob_get_contents()" ob_start():是打开缓冲区的,就是要把您需要生成的静态文件的内容缓存在这里: ob_get_contents():是读出缓冲区里的内容,下面有代码为例: ob_end_clean():这个比较重要,只有使用了这个函数后,缓冲区里的内容才会读取出来: [复制此代码]CODE: if(file_exists("./index.htm")

超简单asp生成静态页面代码

<form method="post" action=""> <textarea name="asp2html" style="display:none"><!--#include file="htmer.asp"--></textarea> <input type="submit" value="生成html页"