RE: [PHP] confusing problem w/sessions
| From: | Quentin Gillet | Date: | Mon, 20 Aug 2001 17:19:09 +0000 |
| Subject: | RE: [PHP] confusing problem w/sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63536@lists.php.net to get a copy of this message | ||
On which platform do you run?
set display_startup_errors = On
so that you eventually will see any php initialization problem (like the
folder where session data is stored being not accessible because of
permission restrictions...I say that because I ran into this problem)
to recap, code should be on first page:
<?php
session_start(); (not necessary if session_auto_start=1)
session_register("a");
$HTTP_SESSION_VARS["a"]="something";
?>
and on second page:
<?php
echo "Value of a is: ".$HTTP_SESSION_VARS["a"];
?>
should return:
Value of a is: something
-----Message d'origine-----
De : Gabriele Biondo [mailto:gbiondo@mac.com]
Envoyé : lundi 20 août 2001 15:11
À : php@leatel.com; PHP
Objet : Re: [PHP] confusing problem w/sessions
> start your session before sending any html output to browser
Okay. This solves the problem w/the warnings
> check that register_globals is on
It is actually on
> if not use $HTTP_SESSION_VARS("a") instead to reference your session var
> assign a value after having initialiazed your var not before
Done. Nothing changes at all...
my variables are saved (session_register("a") returns true) but from the
second page,
wich code is:
<?session_start();
print $HTTP_SESSION_VARS["a"];
print "<br>$a";
?>
i do not see anything at all...
more suggestions?
thanks in advance
Gabriele
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net