RE: [PHP] Session variable scope - surprise!

2002-03-04 Thread Richard Black
I just read further on the manual page for session_register. It also contains the following: Caution This registers a global variable. If you want to register a session variable inside a function, you need to make sure to make it global using global() or use the session arrays as noted below. R

RE: [PHP] Session variable scope - surprise!

2002-03-04 Thread Richard Black
Message- From: Richard Fox [mailto:[EMAIL PROTECTED]] Sent: 04 March 2002 16:03 To: PHP Subject: RE: [PHP] Session variable scope - surprise! Then, when session_register(""); is called (even on a variable which is going out of scope) what actually happens? Where is the dat

RE: [PHP] Session variable scope - surprise!

2002-03-04 Thread Richard Fox
Then, when session_register(""); is called (even on a variable which is going out of scope) what actually happens? Where is the data actually stored? I know it isn't in the file yet (I have session.save_handler = files) because nothing is written to the file until the script exits. So the me

RE: [PHP] Session variable scope - surprise!

2002-03-04 Thread Richard Black
DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Richard Fox [mailto:[EMAIL PROTECTED]] Sent: 04 March 2002 15:26 To: [EMAIL PROTECTED] Subject: RE: [PHP] Session variable scope - surprise! OK, but then how do you expla

RE: [PHP] Session variable scope - surprise!

2002-03-04 Thread Richard Fox
OK, but then how do you explain: "; } global $HTTP_SESSION_VARS; session_start(); reg(); if (session_is_registered("test")) { $tt = $HTTP_SESSION_VARS["test"]; echo "session variable test=<$tt>"; } else echo "You really don't know what you're doing, do you?"; ?> This still gives me

RE: [PHP] Session variable scope - surprise!

2002-03-04 Thread Richard Black
ECTED]] Sent: 04 March 2002 14:57 To: [EMAIL PROTECTED] Subject: [PHP] Session variable scope - surprise! This is a behavior I have not found documented, in fact the books I have read indicated that this would not be the case... given the script (with session.save_handler = files): "; }

[PHP] Session variable scope - surprise!

2002-03-04 Thread Richard Fox
This is a behavior I have not found documented, in fact the books I have read indicated that this would not be the case... given the script (with session.save_handler = files): "; } session_start(); reg(); echo "test=<$test>"; ?> The output is: in reg(), test=<13> test=<> I was quite sur