Re: Re[3]: [PHP] sessions help
Yeah, I thought of that too. Same result, though. At 04:16 PM 6/13/2002, you wrote: >Hmm. Okay. Replace $_SESSION with $HTTP_SESSION_VARS and see if that >works. >-Kevin > >- Original Message - >From: "Leston Drake" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Thursday, June 13, 2002 4:07 PM >Subject: Re[3]: [PHP] sessions help > > > > I've stripped the code down to barest bones to try to figure this out: > > [getglobal.php] > > ... > > echo "Node is {$_SESSION['node']}."; > > ... > > > > [session.php] > > ... > > $_SESSION['node'] = "10.2"; > > ... > > > > Other than the standard html, head, title, body tags and the > > session_start(), there is no other code. > > I'm still getting the "...Undefined index: node ..." warning. > > > > > > >Do a print_r($_SESSION); in getglobal.php to see what the session >contains. > > > > It is: Array() > > > > > >if (!empty($_SESSION)) { > > > >extract($_SESSION); > > > >} else if (!empty($HTTP_SESSION_VARS)) { > > > >extract($HTTP_SESSION_VARS); > > > >} > > > > > >Why are you doing this? If you're accessing the session through $_sESSION >then > > >there's no need to extract the session into the global scope. > > > > With register_globals=Off, I understand that you need to extract the >$_POST > > and $_GET vars. I assumed the same for $_SESSIONS. Is this not true? > > > > TIA, > > Leston > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[3]: [PHP] sessions help
Hmm. Okay. Replace $_SESSION with $HTTP_SESSION_VARS and see if that works. -Kevin - Original Message - From: "Leston Drake" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, June 13, 2002 4:07 PM Subject: Re[3]: [PHP] sessions help > I've stripped the code down to barest bones to try to figure this out: > [getglobal.php] > ... > echo "Node is {$_SESSION['node']}."; > ... > > [session.php] > ... > $_SESSION['node'] = "10.2"; > ... > > Other than the standard html, head, title, body tags and the > session_start(), there is no other code. > I'm still getting the "...Undefined index: node ..." warning. > > > >Do a print_r($_SESSION); in getglobal.php to see what the session contains. > > It is: Array() > > > >if (!empty($_SESSION)) { > > >extract($_SESSION); > > >} else if (!empty($HTTP_SESSION_VARS)) { > > >extract($HTTP_SESSION_VARS); > > >} > > > >Why are you doing this? If you're accessing the session through $_sESSION then > >there's no need to extract the session into the global scope. > > With register_globals=Off, I understand that you need to extract the $_POST > and $_GET vars. I assumed the same for $_SESSIONS. Is this not true? > > TIA, > Leston > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[3]: [PHP] sessions help
I've stripped the code down to barest bones to try to figure this out: [getglobal.php] ... echo "Node is {$_SESSION['node']}."; ... [session.php] ... $_SESSION['node'] = "10.2"; ... Other than the standard html, head, title, body tags and the session_start(), there is no other code. I'm still getting the "...Undefined index: node ..." warning. >Do a print_r($_SESSION); in getglobal.php to see what the session contains. It is: Array() > >if (!empty($_SESSION)) { > >extract($_SESSION); > >} else if (!empty($HTTP_SESSION_VARS)) { > >extract($HTTP_SESSION_VARS); > >} > >Why are you doing this? If you're accessing the session through $_sESSION then >there's no need to extract the session into the global scope. With register_globals=Off, I understand that you need to extract the $_POST and $_GET vars. I assumed the same for $_SESSIONS. Is this not true? TIA, Leston -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[3]: [PHP] sessions help
On Thursday, June 13, 2002 at 10:32:25 PM, you wrote: > Thanks to Julie and Stuart for helping me. > With your direction, I got rid of the warning about the headers by putting > the session_start() at the beginning of the file. > Now I get a different sort of error when I try to retrive the session variable: > --- > Warning: Undefined index: node in c:\program files\apache > group\apache\htdocs\wan\getglobal.php on line 17 > --- Do a print_r($_SESSION); in getglobal.php to see what the session contains. >if (!empty($_SESSION)) { >extract($_SESSION); >} else if (!empty($HTTP_SESSION_VARS)) { >extract($HTTP_SESSION_VARS); >} Why are you doing this? If you're accessing the session through $_sESSION then there's no need to extract the session into the global scope. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[3]: [PHP] sessions help
LD> It's the 1st line after At 03:09 PM 6/13/2002, you wrote: >>LD> I just tried adding session_start() to the beginning of both files. >>When I >>LD> load Doc 1, I get this warning twice(!): >> >>LD> Warning: Cannot send session cache limiter - headers already sent (output >>LD> started at c:\program files\apache >>group\apache\htdocs\wan\sessions.php:7) >>LD> in c:\program files\apache group\apache\htdocs\wan\sessions.php on line 9 >> Check for whitespace, line break, etc before or after the tag, then. These things count as output. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php