// 前置處理,加: elseif($_POST['type']=='編畢'){ mysql_query("update webMail set email='".$_POST['email']."' where eid=".$_POST['eid']); } elseif($_GET['type']=='editMailForm'){ echo editMailForm($_GET['eid']); } 函式加: function editMailForm($eid){ $result=mysql_query("select email from webMail where eid=".$eid); $row=mysql_fetch_array($result,MYSQL_ASSOC); $xx=new makeForm; $xx->elements[]=array('email:','text','email',$row['email']); $xx->elements[]=array('','hidden','eid',$eid); $xx->submitValue='編畢'; $xx->checkWhich='chkMailForm()'; return $xx->makeFormStr(); } 撈資料表改為: $result=mysql_query("select a.wid,b.eid,a.姓名,a.phone,b.email from web a left join webMail b on a.wid=b.wid where a.姓名!=''");//百分比代表萬用字元,只要裡面包含@都可以,left join是左側連結,where a.某欄=b.某欄 $colName=array('序','','wid','姓名','手機','±M','eid','Email'); nicetable函式改為: function nicetable($result,$colName){ $i=1; $str="
《增一人》 | |||||||
".$colValue." | "; } $str.="|||||||
---|---|---|---|---|---|---|---|
".$i." | "; if($j==0){ $str.="編 刪 | "; $str.="".$k." | "; $str.="".$temp[$k]['姓名']." | "; $str.="".$temp[$k]['phone']." | "; } $str.="+"; if($kk){$str.=" 編 —";} $str.=" | "; $str.="".$kk." | "; $str.="".$vv." | "; $j++; if($j==$rs){$j=0;} $str.="