Jump to content

Archived

This topic is now archived and is closed to further replies.

lucerias

Pass Parameter Value

Recommended Posts

I have problem of retaining the parameter value shown as the following code. The pre-assigned value for $Parameter1 is written on page and however, when it goes through the outter if statement, the value is lost because when i do the checking on the value of Parameter1 through the inner if, it returned false or null value.

The idea here is i want to check whether the array is null and pass the $Parameter1 value based on the check on array accordingly.

echo $Parameter1;
if(!isset($Array))

   
        if (!isset($Parameter1))
        {
            echo "true";
        }
       else
        { 
           echo "false"; 
        }
}

Share this post


Link to post
Share on other sites
You are checking whether the Parameter1 variable is not set in the code below:
[code=php:0]if (!isset($Parameter1))[/code]

If its not set, it'll return true. If it is set it'll return false.

If you want it to return true when it is set, and false when its not. Then remove [b]![/b] symbol.

Share this post


Link to post
Share on other sites
Sorry guys, i take your time because of my carelessness, i overlooked the exclamation mark. Very sorry.

Share this post


Link to post
Share on other sites
No problem. Its what we're here for. We get these sort of questions all the time.

Share this post


Link to post
Share on other sites

×

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.