Session variables
| From: | Harpreet | Date: | Tue, 29 Apr 2003 16:34:29 +0000 |
| Subject: | Session variables | ||
| References: | 1 2 3 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19721@lists.php.net to get a copy of this message | ||
I am having an issue with session variables. I define my variables in
global.inc file. When i use the variables in a page callled traffic.php file
i get the following error.
Notice: Undefined index: user in
e:\INetPub\WWWRoot\phpconverted\scripts\global.inc on line 2
But if i press the back button and go again to the traffic page I can login
fine.
Where am i going wrong.
my global1.inc file code is as follows
<?php session_start();
session_register("user");
?>
login.php file code:
<?php
$_SESSION["user"]=$HTTP_POST_VARS["user"];
if ($con="Resource id #1")
{ header("Location: traffic.php");
exit();
}
else
{
header("Location: ../notlogged.htm");
exit;
}
?>