Session Variable Problem

From: Date: Thu, 11 Apr 2002 14:00:04 +0000
Subject: Session Variable Problem
Groups: php.windows 
Request: Send a blank email to php-windows+get-13027@lists.php.net to get a copy of this message
I'm running the latest build of php and Apache under Windows 2000 pro. I have been experimenting with sessions and I'm having a bit of trouble. page 1 I create a session_start() above all of the HTML. I have a 3 form element (a checkbox) with: name="myVar" value="1",name="myVar" value="2",name="myVar" value="3" I session_register("myVar") On submit I go to page two. page 2 I create a session_start() above all of the HTML. I echo $myVar this is where things get weird. The first time I run page 1, when I get to page 2 the value is passed correctly. If I use the browsers back button and change which checkbox I select and then click submit, the value doesn't change and the original value is printed out. If I reload the first page by rekeying in it's URL I get an error message saying that php expected a "," or ";" on line 23. That line is blank in the code and the syntax is correct and I didn't get an error the first time I ran the script. However if I refresh the page it reloads and runs, but again the value doesn't change when I submit it and view the printout on page two. If I set the form method to get and view the variable that is getting passed it looks correct but the session instance of the variable never changes. I have tried everything I could possibly try. I even copied and pasted sample code from www.zend.com with the exact same results. Is this a bug or what am I doing wrong? This is the most frustrating thing I have done in a long time. Ron Herhuth

« previous php.windows (#13027) next »