I'm quite a newbie and have been struggling with sessions (!)
What I'm trying to do is to add submitted values from a textfield (or ID number) to an array which is in a $_SESSION. ( It's for a book site where customers can click on buttons next to books that come up on a search, each book id is submitted into a session and then they can go to a form page which will have all the books they are interested in filled out automatically in a text area field - or at least that's the idea)
Anyway I can't get the session to "remember" the data submitted to the array between pages. At present there's just a simple test form with a textbox & submit button going to a processing page with the following code :
Expand|Select|Wrap|Line Numbers
- <?php
- session_start();
- $AddStuff = $_POST['TestText'];
- if(isset($_SESSION['stuff']))
- $stuff[] = $AddStuff;
- else
- $stuff = array();
- $_SESSION['stuff']=$stuff;
- $stuffNumber = sizeof($stuff);
- ?>
PS ( Apart from not increasing the size of he array the above works alright )
thanks in advance
Andy