Question
create array and store in php session variable
This is probably a simple thing but I am having trouble
getting my head around it.
First: I need one solution where global variables are allowed on the host server as well as one where they are not or a solution where it does not matter
An id is listed in $GET['id'] at each visit to a specific page, but I need a way to store the previous 'id' values as well as the new one.
I wanted to create an array and store it in a session variable and add to it with each subsequent visit to the page.
Then I need to display all those values on the page.
But I just can't get it to work. Well, I can get it to work but it is a huge chunk of code with static variables. I need this to be more efficient code and not tied to an array with static values.
The problem BELOW is that I just can't seem to get this as an array, when the page is accessed it is always a single value.
Can anyone help me get this in a session variable or otherwise help get it working?
First: I need one solution where global variables are allowed on the host server as well as one where they are not or a solution where it does not matter
An id is listed in $GET['id'] at each visit to a specific page, but I need a way to store the previous 'id' values as well as the new one.
I wanted to create an array and store it in a session variable and add to it with each subsequent visit to the page.
Then I need to display all those values on the page.
But I just can't get it to work. Well, I can get it to work but it is a huge chunk of code with static variables. I need this to be more efficient code and not tied to an array with static values.
The problem BELOW is that I just can't seem to get this as an array, when the page is accessed it is always a single value.
Can anyone help me get this in a session variable or otherwise help get it working?
