PHP Form not showing proper error message -
does have idea why showing error message? have tired empty , boolean test.
thanks!
<p>you have full tank of fuel @ <?php echo $intfuelgallons ?> gallons.</p> <p> want top off 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 tires worn. want replace 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 choose if want top off tank! " . ($_post['tanktopoff']) . "</h5></li>"; }; if ((($_post['tirereplace'])!=="no") || (($_post['tirereplace'])!=="yes")) { $errormessage .= "<li><h5>you forgot choose if want replace tires! ". ($_post['tirereplace']) . "</h5></li>"; }; ?>
use
if(empty($_post['tanktopoff'])) instead of
if ((($_post['tanktopoff'])!=="no") || (($_post['tanktopoff'])!=="yes")) and same tirereplace
Comments
Post a Comment