<?php
if($_GET[pg]==''){
$aa=1;
}else{
$aa=$_GET[pg];
}
include("admin/conn.php");
require_once("page.php");
$result=mysql_query("select * from 2carsell ");
$totle=mysql_num_rows($result);
$pagelist = $_GET[t];
if($_GET[t]==''){
$pagelist='200';
}else{
$pagelist=$_GET[t];
}
$pager = new Pager($totle,$pagelist);
$datastat=" 共 <b>".$pager->countall."</b> 条,每次生成 <b>".$pager->countlist."</b> 条,共需生成 <b>".$pager->page."</b> 次";//数据统计
$bb=$pager->page;
$pagenav=$pager->backstr.$pager->thestr.$pager->nextstr;
$limitFrom = $pagelist*($pager->pg-1);
$result=mysql_query("select * from 2carsell ORDER BY id DESC limit $limitFrom,$pagelist");
?>
<center><div style="font-size:14px;"><b>第 <font color=red><?echo $aa?></font > 次页面生成中..<? echo $datastat?></b></div><br>
<?
//php生成静态页面
print "<center><textarea name=textarea class=textarea style='width:520px;height:455px'>";
while($datauser=mysql_fetch_array($result)){
$iid=$datauser[id];
$html = file_get_contents("/moban.php?id=".$iid."");
$sql="select * from 2carsell where id=$iid";
$data=mysql_fetch_array(mysql_query($sql));
$path=date("Ym",$data[PutDate]);
$testdir="html/".$path;
if(file_exists ($testdir)):
else:
mkdir ($testdir, 0777);
echo "目录".$testdir."创建成功!<br>";
endif;
$filename = "html/$path/sell_$iid.html";
// 使用写入模式打开$filename
if (!$handle = fopen($filename, 'w')) {
print "不能打开文件 $filename";
exit;
}
if (is_writable($filename)) {
// 将$html写入到我们打开的文件中。
if (!fwrite($handle, $html)) {
print "不能写入到文件 $filename";
exit;
}
print "文件 $filename 更新成功!\n\r";
fclose($handle);
} else {
print "文件 $filename 不可写";
}
?>
<? }?>
</textarea>
<br><br>
<div style="font-size=12px"><? echo $datastat." "?></div><br><br>
<?
$aa=$aa+1;
if($aa>$bb){
echo '<font color=blue>恭喜,所有页面生成完毕!</font>';
echo "<script>alert('所有文档生成/更新完毕!')</script>";
}else{
echo "<Script> window.location='make.php?t=$pagelist&pg=$aa'; </script>";
}
?>
<?php
require("smarty/Smarty.class.php");
$t = new Smarty;
$t->assign("title","Hello World!");
$content = $t->fetch("templates/index.htm");
//这里的 fetch() 就是获取输出内容的函数,现在$content变量里面,就是要显示的内容了
$fp = fopen("archives/2005/05/19/0001.html", "w");
fwrite($fp, $content);
fclose($fp);
?>
<?php
ob_start();
echo "Hello World!";
$content = ob_get_contents();//取得php页面输出的全部内容
$fp = fopen("archives/2005/05/19/0001.html", "w");
fwrite($fp, $content);
fclose($fp);
?>
<?php
ob_start();//打开浏览器缓存
//下面是读取xml数据
$parser = xml_parser_create(); //创建一个parser编辑器
xml_set_element_handler($parser, "startElement", "endElement");//设立标签触发时的相应函数 这里分别为startElement和endElenment
xml_set_character_data_handler($parser, "characterData");//设立数据读取时的相应函数
$xml_file="1.xml";//指定所要读取的xml文件,可以是url
$filehandler = fopen($xml_file, "r");//打开文件
while ($data = fread($filehandler, 4096))
{
xml_parse($parser, $data, feof($filehandler));
}//每次取出4096个字节进行处理
fclose($filehandler);
xml_parser_free($parser);//关闭和释放parser解析器
$name=false;
$position=false;
function startElement($parser_instance, $element_name, $attrs) //起始标签事件的函数
{
global $name,$position;
if($element_name=="NAME")
{
$name=true;
$position=false;
echo "名字:";
}
if($element_name=="POSITION")
{$name=false;
$position=true;
echo "职位:";
}
}
function characterData($parser_instance, $xml_data) //读取数据时的函数
{
global $name,$position;
if($position)
echo $xml_data."<br />";
if($name)
echo $xml_data."<br />";
}
function endElement($parser_instance, $element_name) //结束标签事件的函数
{
global $name,$position;
$name=false;
$position=false;
}
//xml数据读取完毕
$htmlname=$id.".html";//$id可以自己定义 这里代表用户传来的id
$htmlpath="archives/".$htmlname; //设置路径变量
$content = ob_get_contents();//取得php页面输出的全部内容
$fp = fopen($htmlpath, "w");
fwrite($fp, $content);
fclose($fp);
?>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有