[Cialug] Slightly OT: register_globals in PHP & sessions

Bailey, Jonathan C cialug@cialug.org
Wed, 5 Jan 2005 22:19:55 -0600


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.
>=20
>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] =3D "value";
>
>?>
>
>:) Dave
>
>
>On Wed, 2005-01-05 at 17:48, Bailey, Jonathan C wrote:
> =20
>
>>I currently have register_globals on so that get and post elements can
>>   =20
>>
>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?
> =20
>
>>
>>--------------------
>>Jonathan Bailey
>>POS Analyst
>>bailj0@bp.com
>>(515) 226-5005
>>
>>_______________________________________________
>>Cialug mailing list
>>Cialug@cialug.org
>>http://cialug.org/mailman/listinfo/cialug
>>   =20
>>

_______________________________________________
Cialug mailing list
Cialug@cialug.org
http://cialug.org/mailman/listinfo/cialug