brown2005 Posted March 4, 2007 Share Posted March 4, 2007 i know how to do if($test == "cabbages") but i have forgot how to write if($test does not = "cabbages") thanks in advance Link to comment https://forums.phpfreaks.com/topic/41129-if/ Share on other sites More sharing options...
Orio Posted March 4, 2007 Share Posted March 4, 2007 if($test != "cabbages") Or if($test <> "cabbages") More info. Orio. Link to comment https://forums.phpfreaks.com/topic/41129-if/#findComment-199210 Share on other sites More sharing options...
brown2005 Posted March 4, 2007 Author Share Posted March 4, 2007 which 1 is best wat i want to do is, i have a check box for terms and conditions so if it is not checked i want it to put an error $error .= "You have not accepted the Terms & Conditions"; Link to comment https://forums.phpfreaks.com/topic/41129-if/#findComment-199218 Share on other sites More sharing options...
Archadian Posted March 4, 2007 Share Posted March 4, 2007 use the != (! = not meaning not equal to) Link to comment https://forums.phpfreaks.com/topic/41129-if/#findComment-199220 Share on other sites More sharing options...
Orio Posted March 4, 2007 Share Posted March 4, 2007 For that you need to preform the following check: <?php if(!isset($_POST['checkbox_name'])){ $error .= "You have not accepted the Terms & Conditions"; } ?> Orio. Link to comment https://forums.phpfreaks.com/topic/41129-if/#findComment-199224 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.