Re: Parameter passing question [message #173543 is a reply to message #173541] |
Mon, 18 April 2011 18:23 |
Chuck Lavin
Messages: 5 Registered: April 2011
Karma:
|
Junior Member |
|
|
My point exactly. How can I tell if a URL does not reference a parameter at
all?
I need to move passed parameters into session variables:
1) If a parameter is passed with a value, set the session variable with that
value;
2) If a parameter is passed with an empty value, get rid of that session
variable;
3) If a parameter is not passed at all (not referenced in the URL), don't
touch the session variable.
Tnx
CL
"Unrest" <unrest(at)nullvector(dot)org> wrote in message
news:4dac7f92$0$68307$afc38c87(at)news5(dot)united-newsserver(dot)de...
> Am Mon, 18 Apr 2011 17:42:31 +0000 schrieb Denis McMahon:
>> <?php
>> if (isset($_GET['x'])) {
>> if ($_GET['x'] == null) {
>> // it's null
>> } else {
>> // it has data
>> }
>> } else {
>> // it's not defined
>> }
>> ?>
>>
>
> isset() checks if a variable exists and _is not null_.
> -> http://de.php.net/manual/en/function.isset.php
>
> so your "if ($_GET['x'] == null)" will never evaluate to true.
>
>
> Yours,
> Michael
>
|
|
|