Re[2]: [PHP] sessions help

From: Date: Thu, 13 Jun 2002 21:38:27 +0000
Subject: Re[2]: [PHP] sessions help
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-102078@lists.php.net to get a copy of this message
At 03:32 PM 6/13/2002, 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 ------------------------------- Any ideas why? (Here's the exact code I've got)
This is the code, w/o formatting, and w/o the html tags. Sorry about the formatting in the email
[sessions.php] <?php session_start();?> <?php function sessionSetNode ($node_id) { return ($_SESSION['node'] = $node_id); } sessionSetNode("10.2"); ?> [getglobal.php] <?php session_start();?> <?php if (!empty($_SESSION)) { extract($_SESSION); } else if (!empty($HTTP_SESSION_VARS)) { extract($HTTP_SESSION_VARS); } function sessionGetNode () { return $_SESSION['node']; } $n = sessionGetNode(); echo ("Node is $n."); ?> TIA, Leston -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#102078) next »