When reg_globals is off, you can't access session vars just with $varA and
$varB (thess variables are not set), you need to use
$HTTP_SESSION_VARS['varA'] and $HTTP_SESSION_VARS['varB'] to access these
variables !!
-Message d'origine-
De : ahmad varoqua [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 3 mai 2001 16:31
À : Php General List
Objet : [PHP] sessions and reg_globals=off
Hello, I'm having a problem getting sessions to work with
register_globals=off. The following 2 files work fine if reg_globals=on but
not when off. When I look at the session file it reads like this:
!varA|!varB|
and not like it should:
varA|s:4:funk;varB|s:4:that;
//-sess01.php
?php
session_start();
session_register('varA');
session_register('varB');
?
form action=sess02.php
first name:input type=text name=varA
br
last name:input type=text name=varB
input type=submit value=send
/form
//sess02.php
?php
session_start();
print($varA $varB);
?
What do I have to do to make this work with register_globals off? Thank you
very much for help. (If I get some time/answers I think I'm gonna design a
page that shows sample scripts that work with reg_globals=on and their
equivalents with reg_globals=off; this might be beneficial for some
newbies--such as myself. If anybody would like to contribute, please email
me and you'll be duly credited if such a project comes to fruition. Thanx!)
--ahmad.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]