LongHaul
Jan 2nd 2007, 9:44 pm
This seems like an easy thing to do, but the php.net page about sessions rambles on and on and I don't get it :o
I want a webpage called step1.php. On this page, users see a list and can check as many checkboxes as they want to select items.
Then they click "OK" and go to step2.php. The items they checked on step1.php would be passed on. (I'm thinking, for my purposes, it would be fine to put the checkbox names in an array, and THAT would be passed on to step2.php.)
The Point: I don't understand the part about php session stuff coming BEFORE all the html. At the top of step1.php, I don't yet know what data to store! The user hasn't made his choices yet. How could you EVER be able to store variables at the beginning of a web page??
As an aside, I'd have to figure out how to store the checkbox names in an array too.
I don't want to pass the checkbox values in the url because there could be dozens and it would be so unwieldy. I'd rather do this by temporarily storing the array with a session id. Losing this data when the user closes his browser is fine.
Can someone point me in the right direction?? Thanks! I'll go try to study the php.net page again. *sigh*
I want a webpage called step1.php. On this page, users see a list and can check as many checkboxes as they want to select items.
Then they click "OK" and go to step2.php. The items they checked on step1.php would be passed on. (I'm thinking, for my purposes, it would be fine to put the checkbox names in an array, and THAT would be passed on to step2.php.)
The Point: I don't understand the part about php session stuff coming BEFORE all the html. At the top of step1.php, I don't yet know what data to store! The user hasn't made his choices yet. How could you EVER be able to store variables at the beginning of a web page??
As an aside, I'd have to figure out how to store the checkbox names in an array too.
I don't want to pass the checkbox values in the url because there could be dozens and it would be so unwieldy. I'd rather do this by temporarily storing the array with a session id. Losing this data when the user closes his browser is fine.
Can someone point me in the right direction?? Thanks! I'll go try to study the php.net page again. *sigh*