Reply to Re: session - save data

Your name:

Reply:


Posted by roN on 12/06/06 19:17

"shawnews" <example@example.com> wrote in message
news:GjEdh.438300$R63.352280@pd7urf1no...
> Hi,
>
> 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]
> <?php
> session_start(); // start up your PHP session!
> if ($_POST['country'])
> {
> $_SESSION['country']=$_POST['country'];
> echo "counry's been saved as: ".$_SESSION['country'];
> }
> ?>
> [/top of index.php - nothing above]
> [contact.php (where i wanna use the info)]
> <?php
> 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!

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

roN

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация