jcanker Posted August 22, 2007 Share Posted August 22, 2007 If I set up a series of pages with <form action> that points to the next step in the application process, will I be able to refer back to $_POST[] data directly once it comes time to process the input (provided, of course that I don't use the same form element name throughout)? In otherwords, if <input name='fname'> appears on the page representing the first step, can I later refer to $_POST['name'] after they click through several pages of forms? I suppose I could set $_SESSION variables each step, but that seems tedioius for what I want to accomplish.... Quote Link to comment https://forums.phpfreaks.com/topic/66098-does-post-array-data-stay-until-unset/ Share on other sites More sharing options...
Wuhtzu Posted August 22, 2007 Share Posted August 22, 2007 When you submit a form you submit a POST request to the webserver and the POST data is not stored through additional numbers of requests. So they are wiped as soon as you submit a new request to the server... You should save them as $_SESSION variables: <?php //After submission of step1 $_SESSION['step1'] = $_POST; //After submission of step2 $_SESSION['step2'] = $_POST; ?> This will save each $_POST for you to process later on. Quote Link to comment https://forums.phpfreaks.com/topic/66098-does-post-array-data-stay-until-unset/#findComment-330614 Share on other sites More sharing options...
jcanker Posted August 22, 2007 Author Share Posted August 22, 2007 Bah...that's what I thought, but I was holding out hope that I wouldn't have to define a session var for a var that was already defined.... ah, poop Thanks for the answer tho! Quote Link to comment https://forums.phpfreaks.com/topic/66098-does-post-array-data-stay-until-unset/#findComment-330618 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.