[Cialug] Slightly OT: register_globals in PHP & sessions

Dave J. Hala Jr. cialug@cialug.org
Wed, 05 Jan 2005 18:06:32 -0600


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
-- 

Open Source Information Systems (OSIS)
Dave J. Hala Jr. <dave@osis.us>
641.485.1606