bug to me. Global variables are OFF. I start a session at the very top of page "member.php":
session_start();
In a function called from the same page, I store some variables in the session array:
$pilot = mysql_fetch_array($result); $usrname = $pilot['given']." ".$pilot['last']; $valid_ID = $pilot['ID']; $timestamp = date("U"); session_register("usrname","timestamp","valid_ID");
then in another function called from the same page (or a different page, since this is where I find which
user is sending in a page), I attempt to use the "timestamp" data. Three "echo" lines are added to provide
some debugging help.
if (session_is_registered("valid_ID")){ echo "inside check IF <br>"; $current_time = date("U"); echo "Time = $current_time.<br>"; $session_time = $current_time - $_SESSION('timestamp'); echo "session time = $session_time seconds.<br>";
The output to the browser (Safari) is as follows:
inside check IF Time = 1072308706.
Fatal error: Call to undefined function: array() in
/Library/WebServer/Documents/testit/Logsafe_project/user_auth_fns.php on line 35
As you can see, the code bombs as soon as it hits the $_SESSION('timestamp'). Note that it did pass through
(session_is_registered("valid_ID") successfully and if I go look in the directory where the cookie would go,
it is there.
I am operating in system 10.3.2 (Panther) and, as far as I can tell, using php 4.3.2. Any help would be appreciated.
Jim
-- Jim Feldman 14 Linda Lane Newton, MA 02461
617-527-0509