lurah Posted September 18, 2006 Share Posted September 18, 2006 Hi all.I have tried to search answer but havent got this solved.write.php receives $_POST values from another file. Values are passed as should. I tested many times with echo $value.[code]if (($cat != "new") && ($newcat != "")) { echo "Select \"New category\" to create it.<br>"; $false++; }[/code][code]if ($cat_new != "") { if ($cat != "new") { echo "Select \"New category\" to create it.<br>"; $false++; } }[/code]Both ways, i allways end up on $false++ even the values are right.So the idea is, that if $cat_new != "", then $cat must be "new" or $false increases. Quote Link to comment Share on other sites More sharing options...
DarkHavn Posted September 18, 2006 Share Posted September 18, 2006 Well there a couple of options you can goif(){elseif() {}}or in this case i would go with switch statementsswitch($_POST){case $cat != "new":echo "yep"breal;case empty($cat):echo "empty";break;}in a rush so search google.com for php switch statement tutorial Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 18, 2006 Share Posted September 18, 2006 Are you checking if register globals is on??Maybe you need...[code]<?phpif (($_POST['cat'] != "new") && ($_POST['newcat'] != "")) { echo "Select \"New category\" to create it.<br>"; $false++; }?>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.