$_POST variables disappear
Posted: Tue Jul 13, 2004 7:27 am
I have two forms on one page, but the output from the first form contains the second form so the second form isn't displayed until the first form is submitted.
The variables are submitted via POST and then POST is copied to $_SESSION[_POST].
When I run the first form I can see that $_SESSION['_POST'] contains the data I want and I can refer to it in the output of the first form. However when I submit the second form I lose the data from the first form and $_SESSION['_POST'] only contains the data submitted by the second form - but I still need to display some of the data submitted from the first form.
I could see why this would be the case if I was only referring to the $_POST superglobal but when I've copied everything to $_SESSION shouldn't the data from the second form just be added as new array elements to $_SESSION['_POST'] rather than it all being removed?
All the other data I need is still present in $_SESSION, its just the data in $_SESSION['_POST'] that is being reset for some reason.
I suppose I could rename the $_SESSION['_POST'] to something else and then refer to this but this seems messy since I don't undertand why its not working the way I though it should
The variables are submitted via POST and then POST is copied to $_SESSION[_POST].
When I run the first form I can see that $_SESSION['_POST'] contains the data I want and I can refer to it in the output of the first form. However when I submit the second form I lose the data from the first form and $_SESSION['_POST'] only contains the data submitted by the second form - but I still need to display some of the data submitted from the first form.
I could see why this would be the case if I was only referring to the $_POST superglobal but when I've copied everything to $_SESSION shouldn't the data from the second form just be added as new array elements to $_SESSION['_POST'] rather than it all being removed?
All the other data I need is still present in $_SESSION, its just the data in $_SESSION['_POST'] that is being reset for some reason.
I suppose I could rename the $_SESSION['_POST'] to something else and then refer to this but this seems messy since I don't undertand why its not working the way I though it should