難道你只是echo
的形式一樣嗎echo'd
javascript
?
<?php
if($dun==0){
echo '
<form name="form1"><input type="submit" name="submit1" /></form>
';
}
else if($toplam==0){
echo '
<form name="form2"><input type="submit" name="submit2" /></form>
';
}
else if($toplam==$dun){
header('Location: member.php');
}else{
echo "<script> alert('Error.');history.go(-1);</script>";
}
?>
如果你想這取決於if
語句將數據插入到數據庫中,那麼你可以添加functions
:
<?php
function doForm1(){
//MYSQL HERE
}
function doForm2(){
//MYSQL HERE
}
if($dun==0){
echo '
<form name="form1"><input type="submit" name="submit1" /></form>
';
doForm1();
}
else if($toplam==0){
echo '
<form name="form2"><input type="submit" name="submit2" /></form>
';
doForm2();
}
else if($toplam==$dun){
header('Location: member.php');
}else{
echo "<script> alert('Error.');history.go(-1);</script>";
}
?>
什麼是'$ dun',什麼是'$ toplam'? – chriz 2013-03-27 16:10:43
$ dun從數據庫的價值和$ toplam是價格來自另一種形式 – PcRestorer 2013-03-27 16:15:58