我有一個表格,我需要填寫一個字段。我正在嘗試但沒有取得任何成功。驗證表格php 4個輸入,必須填寫一個
請指出我在哪裏做錯了。
if($text1=='' && $text2=='' && ($text3!='' || $text4!='' || $text5!='' || $text6!='')){
$abc->redirect('../xxxx.php');
exit;
}
<tr>
<td>title: $</td>
<td><input type="text" id="dailyprice" name="text1" style="height: 25px; border: 1px solid #888; width: 80px;"></td>
<td>Desc: $</td>
<td><input type="text" id="weeklyprice" name="text2" style="height: 25px; border: 1px solid #888; width: 80px;"></td>
</tr>
<tr>
<td>Daily Price: $</td>
<td><input type="text" id="dailyprice" name="text3" style="height: 25px; border: 1px solid #888; width: 80px;"></td>
<td>Weekly Price: $</td>
<td><input type="text" id="weeklyprice" name="text4" style="height: 25px; border: 1px solid #888; width: 80px;"></td>
</tr>
<tr>
<td>Weekend Price: $</td>
<td><input type="text" id="weekendprice" name="text5" style="height: 25px; border: 1px solid #888; width: 80px;"></td>
<td>Monthly Price: $</td>
<td><input type="text" id="monthlyprice" name="text6" style="height: 25px; border: 1px solid #888; width: 80px;"></td>
</tr>
感謝
「不成功」不是問題 – zerkms 2012-07-16 22:41:01
的解釋你是說只有一個字段需要填充或所有領域? – DrinkJavaCodeJava 2012-07-16 22:42:22
text1或text2必須填寫OR(text3 text4 text5和text6)必須填寫 – 2012-07-16 22:43:52