有沒有人有任何想法,爲什麼這是顯示錯誤信息?我厭倦了空洞和布爾測試。PHP表單不顯示正確的錯誤信息
謝謝!
<p>You have nearly a full tank of fuel at <?php echo $intFuelGallons ?> gallons.</p>
<p> Do you want to top off your tank?
<label>
<input type="radio" name="TankTopOff" value="Yes" id="TankTopOff">
Yes</label>
<label>
<input type="radio" name="TankTopOff" value="No" id="TankTopOff">
No</label>
</p>
<p><?php echo $varWornTires ?> of your tires are worn. Do you want to replace any of them?</p>
<label>
<input type="radio" name="TireReplace" value="Yes" id="TireReplace">
Yes</label>
<label>
<label>
<input type="radio" name="TireReplace" value="No" id="TireReplace">
No</label>
<label>
<?php
if ((($_POST['TankTopOff'])!=="No") || (($_POST['TankTopOff'])!=="Yes")) {
$errorMessage .= "<li><h5>You forgot to choose if you want to top off your tank! " . ($_POST['TankTopOff']) . "</h5></li>";
};
if ((($_POST['TireReplace'])!=="No") || (($_POST['TireReplace'])!=="Yes")) {
$errorMessage .= "<li><h5>You forgot to choose if you want to replace any tires! ". ($_POST['TireReplace']) . "</h5></li>";
};
?>
首先,代之以''errorMessage' $ errorMessage' – 6339 2013-05-03 11:36:22