Re: [PHP] understanding session vars ?

2005-11-24 Thread David Grant
Gregory, Are you always setting $_SESSION['menu'] to the contents of $_GET['menu']? If so, the second link will set $_SESSION['menu'] to null. You need to check the contents of $_GET['menu'] first before setting, i.e. if (isset($_GET['menu'])) $_SESSION['menu'] = $_GET['menu']; Cheers,

Re: [PHP] understanding session vars ?

2005-11-24 Thread Gregory Machin
I have a test script.. What i'm trying to achieve is once the user has clicked on link1 the value of item must equal x and if the user clicks on link2 the value of items must stay equal to x while setting action equal to y .. ?php session_start(); echo 'Welcome to testpg'; $_SESSION['time']=

Re: [PHP] understanding session vars ?

2005-11-24 Thread David Grant
Gregory, Values in the $_SESSION superglobal will persist over pages so long as session_start() is called on each page. Cheers, David Grant Gregory Machin wrote: I have a test script.. What i'm trying to achieve is once the user has clicked on link1 the value of item must equal x and if

Re: [PHP] understanding session vars ?

2005-11-24 Thread Gregory Machin
My test code is for test.php which is intended to call it's self, and starts with sesstion_start(). buy does not disply x after link2 is clicked on, but only y.. what am I missing ? Thanks On 11/24/05, David Grant [EMAIL PROTECTED] wrote: Gregory, Values in the $_SESSION superglobal will

Re: [PHP] understanding session vars ?

2005-11-24 Thread David Grant
Gregory Gregory Machin wrote: My test code is for test.php which is intended to call it's self, and starts with sesstion_start(). buy does not disply x after link2 is clicked on, but only y.. what am I missing ? x wouldn't display because it depends on $_GET['item'] being set, which isn't.

RE: [PHP] understanding session vars ?

2005-11-24 Thread Ford, Mike
On 24 November 2005 10:24, Gregory Machin wrote: I have a test script.. What i'm trying to achieve is once the user has clicked on link1 the value of item must equal x and if the user clicks on link2 the value of items must stay equal to x while setting action equal to y .. ?php