Jump to content


Photo

Pass Parameter Value


  • Please log in to reply
3 replies to this topic

#1 lucerias

lucerias
  • Members
  • PipPipPip
  • Advanced Member
  • 101 posts

Posted 29 September 2006 - 08:33 AM

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"; 
        }
}

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 29 September 2006 - 08:50 AM

You are checking whether the Parameter1 variable is not set in the code below:
if (!isset($Parameter1))

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 ! symbol.

#3 lucerias

lucerias
  • Members
  • PipPipPip
  • Advanced Member
  • 101 posts

Posted 29 September 2006 - 09:03 AM

Sorry guys, i take your time because of my carelessness, i overlooked the exclamation mark. Very sorry.

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 29 September 2006 - 09:05 AM

No problem. Its what we're here for. We get these sort of questions all the time.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users