--On Monday, June 23, 2003 08:30:19 AM -0600 "Johnson, Kirk" <[EMAIL PROTECTED]> wrote:
So what is the diffirent between :
session_start (); $_SESSION['eventid'] = 'arma2';
and
session_start (); session_register('arama2');
Use the first method to create session variables when register_globals is "off" in the php.ini file. Use the second method when it is "On".
http://www.php.net/session
Kirk
First, there is a bit of a coding error here. The two examples should be:
session_start (); $_SESSION['eventid'] = 'arma2';
and
session_start (); session_register('eventid');
Second, the documentation indicates that if you turn off register globals you must us the super global $_SESSION[]. But, it later says that $_SESSION[] and session_register() set the same values. (It does talk about a problem with this in 4.2.3 that is fixed in 4.3)
My question is what is the effect of mixing these two techniques. For example with register globals off should:
session_start (); session_register('eventid'); $_SESSION['eventid'] = 'foo';
Does the session_register() hurt? What is the interaction?
The larger question for us a PRIDE is we have quite a bit of code that assumes register globals is on and we are doing new development where we would like to the the super global $_SESSION[] support instead of the older techniques. What are the consequences of mixing the two techniques?
Thanks in advance,
Bill
+----------------------------------------------- | Bill MacAllister | Senior Programmer, Pride Industries | 10030 Foothills Blvd., Roseville CA 95747 | Phone: +1 916.788.2402 Fax: +1 916.788-2540
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php