FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Parameter passing question
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Parameter passing question [message #173554 is a reply to message #173552] Mon, 18 April 2011 19:21 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Mon, 18 Apr 2011 15:11:10 -0400, sheldonlg wrote:

> On 4/18/2011 2:20 PM, Chuck Lavin wrote:
>> This is not a homework assignment. I'm working on a live remote server
>> that I'd rather not be playing around with.
>>
>> According to the PHP doc page for isset(), isset() can't tell the
>> difference between a variable that's not set and a variable that's
>> empty.
>>
>> 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.
>>
>> And right now I can't tell the difference between a parameter being
>> passed empty and no parameter being passed at all.
>
> Uh, why do you care? If it is passed empty, then you get rid of it with
> unset($_SESSION['the variable']. If it is not passed at all, and it
> should have been if not empty, then do the unset as well. If it hadn't
> been set, nothing happens.
>
> So, why do care about the difference?

Uh, I think his requirement is:

If the param is set and empty, set session value to an empty string

If the param is set and contains data, set session value to data

If the param is not present, used a stored session value if one is present

I'm not sure what he wants to do if the param is not present and there's
no stored session param, but I assumed he'd accept an empty string in
that case too.

Rgds

Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: & - form and session problem!
Next Topic: doctype not found?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 11:59:24 GMT 2024

Total time taken to generate the page: 0.04591 seconds