session - save data

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I would like to enable ppl a country choice on the first page and it should  
be saved while they're resting on my site so i can pre-select it on the  
contact form, I tried following:
[top of index.php - nothing above]
session_start(); // start up your PHP session!
if ($_POST['country'])
  echo "counry's been saved as: ".$_SESSION['country'];
[/top of index.php - nothing above]
[contact.php (where i wanna use the info)]
if ($_SESSION['country'])
  echo $_SESSION['country'];
[/contact.php (where i wanna use the info)]
it wouldn't echo anything on contacvt.php....what have i forgotten/overseen?
Help apprecaited!
Thanks very much!


Re: session - save data

Quoted text here. Click to load it

Got it, thank you anyways, i just needed to start the session by  
"session_start(); " in contact.php as well :)


Site Timeline