[Cialug] Slightly OT: register_globals in PHP & sessions

David Champion cialug@cialug.org
Thu, 06 Jan 2005 14:25:43 -0600


How about some sample code? I'm with Tony on this one.

p.s. This would be totally on topic on the CIAPUG list. This "group" 
isn't very active, but a lot of the heavy PHP users on this list are on 
that one.

http://www.cialug.org/mailman/info/ciapug/

-dc

Bailey, Jonathan C wrote:
> For some reason it does. I've verified the behavior.
> 
> 
> Jon
> 
> -----Original Message-----
> From: cialug-admin@cialug.org [mailto:cialug-admin@cialug.org]On Behalf
> Of Tony Bibbs
> Sent: Wednesday, January 05, 2005 10:12 PM
> To: cialug@cialug.org
> Subject: Re: [Cialug] Slightly OT: register_globals in PHP & sessions
> 
> 
> register_globals has no effect on session handling.  That is, turning it 
> on shouldn't make the values in $_SESSION available.
> 
> --Tony
> 
> Bailey, Jonathan C wrote:
> 
> 
>>I need the register globals on for the bad practices of others.. I just
>>don't want variables like $_SESSION["whatever"] to get registered as
>>$whatever. I want session variables to stay in $_SESSION.
>>
>>
>>Jon
>>
>>
>>-----Original Message-----
>>From: cialug-admin@cialug.org [mailto:cialug-admin@cialug.org]On Behalf
>>Of Dave J. Hala Jr.
>>Sent: Wednesday, January 05, 2005 6:07 PM
>>To: Cialug
>>Subject: Re: [Cialug] Slightly OT: register_globals in PHP & sessions
>>
>>
>>You should turn register globals off, its not a "best practice".
>>
>>Get your post/get variables using the $_POST[variable] or
>>$_GET[variable]
>>
>>For your session varaible, I'm assuming you registered "whatever" by
>>doing a "session_register("whatever");" on your homepage.
>>
>>At the beginning of your script that wants access to the session
>>variable be sure you do a session_start();
>>
>>it would look like this:
>><?
>>session_start()
>>
>>$_SESSION[whatever] = "value";
>>
>>?>
>>
>>:) Dave
>>
>>
>>On Wed, 2005-01-05 at 17:48, Bailey, Jonathan C wrote:
>> 
>>
>>
>>>I currently have register_globals on so that get and post elements can
>>>   
>>>
>>
>>be registered as variables. This has also set $_SESSION["whatever"] to
>>just $whatever. How do I get it to make get/post as global, but access
>>sessions through $_SESSION?
>> 
>>
>>
>>>--------------------
>>>Jonathan Bailey
>>>POS Analyst
>>>bailj0@bp.com
>>>(515) 226-5005
>>>
>>>_______________________________________________
>>>Cialug mailing list
>>>Cialug@cialug.org
>>>http://cialug.org/mailman/listinfo/cialug
>>>   
>>>
> 
> 
> _______________________________________________
> Cialug mailing list
> Cialug@cialug.org
> http://cialug.org/mailman/listinfo/cialug
> _______________________________________________
> Cialug mailing list
> Cialug@cialug.org
> http://cialug.org/mailman/listinfo/cialug
>