$id = $_GET["RecID"];
$sqlstr = "select * from news";
$re = mysql_query($sqlstr);$fp  = fopen ("temp.html","r");
$content  = fread ($fp,filesize ("temp.php"));
$content .= str_replace ("{title}",$row["Title"],$content);
$content .= str_replace ("{content}",$row["Content"],$content);
  
   
 $filename = "test/'".$id."'.html";
 $handle    = fopen ($filename,"w");
  
 if (!is_writable ($filename))
{
      die ("文件:".$filename."不可写,请检查其属性后重试!");
}

 if (!fwrite ($handle,$content))
 {  
      die ("生成文件".$filename."失败!");
  } 

  fclose ($handle);
   
  die ("创建文件".$filename."成功!");
}