<?$m=mysql_connect("localhost","×××","×××××"); mysql_select_db("×××××",$m); $zw=ereg_replace("<","<",$zw); $zw=ereg_replace(">",">",$zw); $zw=ereg_replace("n","<br>",$zw); $zw=ereg_replace(" "," ",$zw); $tt=ereg_replace("<","<",$tt); $tt=ereg_replace(">",">",$tt); if ($nm=="") $nm="无名宝"; if ($em=="") {$nm.="<-- 是一只没有MAIL的菜鸟";$em="No";} $err=strlen($tt)*strlen($zw); if ($err==0) $msg="<font color=red>不要偷懒嘛!把表格填完再提交不迟。</font>"; else {$q="insert into yxforum (dt,tp,ct,fl,ip,un,em,num) values" ."(now(),"".$tt."","".$zw."",".$fl.","".$REMOTE_ADDR."","".$nm."","".$em."",0)"; mysql_query($q,$m);
$q="select num,fl from yxforum where id=".$fl; $fl_a=$fl; do { $mr=mysql_query($q,$m); $ra=mysql_fetch_row($mr); $num=$ra[0]+1; $q="update yxforum set dt=now(),num=".$num." where id=".$fl; $fl=$ra[1]; mysql_query($q,$m); $q="select num,fl from yxforum where id=".$fl; } while ($fl>0);