新闻生成静态HTML页面时怎么得到ob_get_contents()。 用OB函数生成静态HTML页面时,怎么能得到类似news.php?id=1的ob_get_contents()内容。请高手指导! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ???========================ob_start();require_once('news.php?id=1');$page = ob_get_contents();ob_end_clean();......echo $page <? $id=$_POST['id'];$htmlname=date("Ymd").$id.".html";$htmlpath="html/".$htmlname;function createhtml($id,$objectPage){if (is_file ($objectPage)){ @unlink ($objectPage); } ob_start(); $content=file_get_contents("http://127.0.0.1/yinshua/news.php?fid=$id"); echo "$content"; $cons=ob_get_contents(); ob_end_clean(); $fp=fopen($objectPage,"wb") or die("静态生成时打开文件".$objectPage."时出错"); fwrite($fp,$cons); fclose($fp); return true;} if(isset($_POST['Submit'])) { createhtml($id,$htmlpath); } ?><form name="form2" method="post" action="<?=$PHP_SELF?>"><table><tr bgcolor="#FFFFFF"> <td width="49" > <?php include_once('include/db_class.php'); $result1=$db->query("select * from article order by id limit 0,12"); while($row1=$db->getarray($result1)){?> <TR> <TD class=cl align=right> <input type="radio" name="id" value="<?=$row1[id]?>"> <?=$row1[title]?></TD></TR> <TR><TD height="5"></TD></TR> <?php } ?></td></tr></table> <input type="submit" name="Submit" value="加载页面"> </form> $content=file_get_contents("http://127.0.0.1/yinshua/news.php?fid=$id");============================================================http://127.0.0.1/yinshua/news.php?fid=$id --> 改成相对地址. o,试试fsockopen打开,肯定不是ob函数的问题。 php时间调用问题 php程序能不能捕捉摄像头画面 php共有多少种处理表单变量的方式? phper新手问题 我刚申请的20m免费php空间,不敢独享... 高手请进!!!!!!! 說說基于瀏覽器項目的報表制作 PHP的一个BUG?????? 请问各位,如何才能够知道访问者是从哪里或哪个页面访问来的? 新人跪求大神赐招 通过DLL读取语言包显示UTF-8乱码问题 请各位帮忙关于正则表达式怎么写
========================
ob_start();
require_once('news.php?id=1');
$page = ob_get_contents();
ob_end_clean();
..
..
..
echo $page
$htmlname=date("Ymd").$id.".html";
$htmlpath="html/".$htmlname;
function createhtml($id,$objectPage)
{if (is_file ($objectPage)){
@unlink ($objectPage);
}
ob_start();
$content=file_get_contents("http://127.0.0.1/yinshua/news.php?fid=$id");
echo "$content";
$cons=ob_get_contents();
ob_end_clean();
$fp=fopen($objectPage,"wb") or die("静态生成时打开文件".$objectPage."时出错");
fwrite($fp,$cons);
fclose($fp);
return true;
}
if(isset($_POST['Submit']))
{
createhtml($id,$htmlpath);
}
?>
<form name="form2" method="post" action="<?=$PHP_SELF?>">
<table>
<tr bgcolor="#FFFFFF">
<td width="49" > <?php
include_once('include/db_class.php');
$result1=$db->query("select * from article order by id limit 0,12");
while($row1=$db->getarray($result1)){?>
<TR>
<TD class=cl align=right>
<input type="radio" name="id" value="<?=$row1[id]?>">
<?=$row1[title]?></TD></TR>
<TR><TD height="5"></TD></TR>
<?php } ?></td></tr></table>
<input type="submit" name="Submit" value="加载页面">
</form>
============================================================
http://127.0.0.1/yinshua/news.php?fid=$id --> 改成相对地址.