RE: [PHP] sessions and reg_globals=off

From: Date: Thu, 03 May 2001 14:16:38 +0000
Subject: RE: [PHP] sessions and reg_globals=off
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-51274@lists.php.net to get a copy of this message
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:ak-47@americanmotorcycle.com] 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: 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

« previous php.general (#51274) next »