<?php
$mysql="localhost";
$dbname="root";
$dbpwd="";
$db="news";
$conn=@mysql_connect($mysql,$dbname,$dbpwd) or die("Á¬½ÓÊý¾Ý¿âʧ°Ü!");
@mysql_select_db($db,$conn) or die("Ñ¡Ôñ±í1ʧ°Ü!");
mysql_query("set names 'gb2312' ");
$query=mysql_query("SELECT ask.id, ask.title, askanswer.content from ask, askanswer");
while($row=mysql_fetch_array($query))
{
$id=$row[0];
$title=$row[1];
$content1=$row[2];
$path="html/";
$path=$path.$id.".html";
$fp=fopen("tmp.htm","r"); //Ö»¶Á´ò¿ªÄ£°å
$str=fread($fp,filesize("tmp.htm"));//¶ÁÈ¡Ä£°åÖÐÄÚÈÝ
$str=str_replace("{title}",$title,$str);
$str=str_replace("{content1}",$content1,$str);//Ìæ»»ÄÚÈÝ
fclose($fp);
$handle=fopen($path,"w"); //дÈ뷽ʽ´ò¿ªÐÂÎÅ·¾¶
fwrite($handle,$str); //°Ñ¸Õ²ÅÌæ»»µÄÄÚÈÝд½øÉú³ÉµÄHTMLÎļþ
fclose($handle);
echo "Éú³É³É¹¦"."<br>";
}
?>
Õâ¸ö´úÂëΪʲôִÐкó»áÈçͼ1:
ͼ1
(ͼ1)
Éú³ÉµÄÁ½¸öHTMLÎļþµÄ±êÌâÊǶԵÄ,µ«ÊÇÄÚÈÝÈ´²»Ò»Ñù:Èçͼ2,ͼ3
ͼ2
ͼ2
ͼ3
ͼ3
ͼ3
file_get_contents
file_put_contents
ÎÒÔÚÍøÕ¾µÄÒýµ¼Ò³ÖÐÌí¼ÓÁË<embed src="ÒôÀÖµØÖ·" autostart="true" loop="true" hidden="true"></embed>
Õâ¾ä»°£¬È»ºóÌøתҳÃæºó£¬±³¾°ÒôÀÖ¾ÍûÓÐÁË£¬ÔõôÈÃÕ ......
1¡¢ÊDz»ÊÇPHPÖÐÖ»ÄÜʹÓÃmysql_query("update user_aa set money=money2-".$bpanmm." where uid=".$userppp);¸üÐÂÊý¾Ý£¿£¿£¿
2¡¢PHP¸üÐÂmysql_fetch_row($res)Óëmysql_fetch_array($res)ÖеÄÊý¾ ......