Re: Session variables

From: Date: Tue, 29 Apr 2003 17:11:01 +0000
Subject: Re: Session variables
References: 1 2 3 4  Groups: php.windows 
Request: Send a blank email to php-windows+get-19723@lists.php.net to get a copy of this message
Um looks to me like you are starting a session variable without any values... I do not think that is acutally possible hense the error message you got. session_register() is not supposed to be used in php 4.3.0>, I would stick with using $_SESSION[] = as you have done on the second script ----- Original Message ----- From: "Harpreet" <harpreet@crispincorp.com> To: <php-windows@lists.php.net> Sent: Tuesday, April 29, 2003 5:34 PM Subject: [PHP-WIN] Session variables > 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; > } > ?> > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.windows (#19723) next »