Yep first of all $_session doesn't exist
$_SESSION does though, so lets not forget about case sensitivity.
For portablity sake ALWAYS make sure you use
$_SESSION['test']="string";
Especially if you're not sure what version of PHP the host is running,
and/or what there php.ini reads like.
Also if register globals is on and there is a $_POST['test'] or a
$_GET['test'] you could get a conflicting variable that will be a HUGE
pain in the ass to track down.
Always best to test as far up the pipe as you can and then explicitly
assign.
I do it one of two ways, depending on what exactly I need.
I call this extremely explicit
if($_POST['test']){
$test = $_POST['test'];
$_SESSION['test']=$test;
}elseif($_GET['test']){
$test = $_GET['test'];
$_SESSION['test']=$test;
}elseif($_SESSION['test']){
$test = $test;
$_SESSION['test']=$test;
}
Or the sloppy way
extract($_SESSION);
If register globals (I think thats it) is turned on $_SESSION['test']
will automagically update, otherwise $_SESSION['test']=$test; is the
only way to go.
Someone please correct me, on the register globals comment, if I'm
wrong, but I know it's something.
Anyways more details can be had here
http://us2.php.net/manual/en/reserve...iables.session
"Stijn Goris" <me*****@hotmail.com> wrote in message news:<3f*********************@reader3.news.skynet. be>...
hi all,
Having a session variable test .
Is there a difference between:
$test = "string";
or
$_session['test'] = "string";
kind regards
Stijn