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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.