- 论坛徽章:
- 0
|
急:
用php生成静态页的时候,总这样的错误:
Warning: main() [function.main]: URL file-access is disabled in the server configuration in /home/ku27137/public_html/admin/html1.php on line 10
Warning: main(http://www.xxx.cn/news/show.php?id=2) [function.main]: failed to open stream: no suitable wrapper could be found in /home/ku27137/public_html/admin/html1.php on line 10
Warning: main() [function.main]: URL file-access is disabled in the server configuration in /home/ku27137/public_html/admin/html1.php on line 10
Warning: main(http://www.xxx.cn/news/show.php?id=2) [function.main]: failed to open stream: no suitable wrapper could be found in /home/ku27137/public_html/admin/html1.php on line 10
Warning: main() [function.include]: Failed opening 'http://www.xxx.cn/news/show.php?id=2' for inclusion (include_path='.:/usr/share/php4:/usr/share/php') in /home/ku27137/public_html/admin/html1.php on line 10
附php源码:
<?
ob_start();
$nid=$_GET["id"];
if (empty($nid))
{
exit;
}
include("http://".$_SERVER['HTTP_HOST']."/news/show.php?id=$nid");
$contents=ob_get_contents();
ob_end_clean();
echo $nid;
$n=1;
$targetFile="../html/".$nid.".html";
$fp=@fopen($targetFile,"w+") ;
fwrite($fp,$contents);
echo "<meta http-equiv='refresh' content='1;URL=$targetFile' />";
exit;
?>
[ 本帖最后由 songsy 于 2007-5-31 21:49 编辑 ] |
|