Jump to content

IF inside IF


lurah

Recommended Posts

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.
Link to comment
Share on other sites

Are you checking if register globals is on??

Maybe you need...
[code]
<?php

if (($_POST['cat'] != "new")  && ($_POST['newcat'] != ""))
                  { 
                          echo "Select \"New category\" to create it.<br>";
                          $false++;
                    }
?>
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.