Jump to content

sessions


spearchilduser

Recommended Posts

hey i think i may have stored session variables incorrectly

 $_SESSION['tel'] = $_GET['Lat'];
		$_SESSION['Lon'] = $_GET['Lon'];
		$_SESSION['Lat'] = $_GET['Lat'];

is what i used to set the session variables with the data i then enter these into a table and they enter the correct information but two pages down the line i try to access them however i just get undefined variable when i set the variable is equal to the session.

$MyLon = $_SESSION['Lon'];
$MyLat = $_SESSION['Lat'];

 

the following is the errorr

Notice: Undefined index: Lat in
Link to comment
https://forums.phpfreaks.com/topic/261178-sessions/
Share on other sites

It will print to the screen what is currently in your $_GET array. It will let you know if they are being populated correctly from your form. Put it right before you assign to your session array:

var_dump($_GET);
$_SESSION['tel'] = $_GET['Lat'];
		$_SESSION['Lon'] = $_GET['Lon'];
		$_SESSION['Lat'] = $_GET['Lat'];

This will print some text out to the screen to let you know what is in your GET array. Copy that output and paste it here.

Link to comment
https://forums.phpfreaks.com/topic/261178-sessions/#findComment-1338474
Share on other sites

thats gunna be a little difficult becuase the information is gathered on the login page which then goes to another page whcih checks the login details and where it stores the details into sessions then redirects you to another page so at no point can i check but now ive added that line in it does like the page syas theres a problem

Link to comment
https://forums.phpfreaks.com/topic/261178-sessions/#findComment-1338485
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.