tefuzz Posted April 19, 2009 Share Posted April 19, 2009 After doing some research on a multiple step form, I have decided to use a single page, and an output according to the step that the user is on. My question is, do the values stay in $_POST even if the page is refreshed and more values are passed through $_POST? Quote Link to comment https://forums.phpfreaks.com/topic/154792-question-about-passing-values/ Share on other sites More sharing options...
Maq Posted April 19, 2009 Share Posted April 19, 2009 Can you post an example? Every time you submit or refresh the page, you need to catch/pass the variables. Quote Link to comment https://forums.phpfreaks.com/topic/154792-question-about-passing-values/#findComment-813989 Share on other sites More sharing options...
tefuzz Posted April 19, 2009 Author Share Posted April 19, 2009 Can you post an example? Every time you submit or refresh the page, you need to catch/pass the variables. ok, so if on step 1 i have a field 'name' and i validate it, and now move to step 2 the value of 'name' would be there, since the page had been reloaded only once to validate the $_POST. But would be lost after the visitor submits step 2 correct? Quote Link to comment https://forums.phpfreaks.com/topic/154792-question-about-passing-values/#findComment-813990 Share on other sites More sharing options...
meomike2000 Posted April 19, 2009 Share Posted April 19, 2009 when you post a new form i believe that POST[] values would be lost unless you pass them along with a hidden input type..... hope that helps mike..... Quote Link to comment https://forums.phpfreaks.com/topic/154792-question-about-passing-values/#findComment-814052 Share on other sites More sharing options...
Maq Posted April 19, 2009 Share Posted April 19, 2009 Can you post an example? Every time you submit or refresh the page, you need to catch/pass the variables. ok, so if on step 1 i have a field 'name' and i validate it, and now move to step 2 the value of 'name' would be there, since the page had been reloaded only once to validate the $_POST. But would be lost after the visitor submits step 2 correct? Yes it would be lost. You can either store it in a session or a hidden field like meomike mentioned, to retain the values. Quote Link to comment https://forums.phpfreaks.com/topic/154792-question-about-passing-values/#findComment-814055 Share on other sites More sharing options...
tefuzz Posted April 20, 2009 Author Share Posted April 20, 2009 Yes it would be lost. You can either store it in a session or a hidden field like meomike mentioned, to retain the values. I was planning on using a session, but it's a 6 part form...It's an application, so some replies i got on here were if the user took too long to complete the steps the session would be lost. I guess my best bet is to stick them all into hidden fields after validation. Quote Link to comment https://forums.phpfreaks.com/topic/154792-question-about-passing-values/#findComment-814150 Share on other sites More sharing options...
teynon Posted April 20, 2009 Share Posted April 20, 2009 Whoever uses a session that expires before a form can be filled out is an idiot. Your session will last. Hidden fields can be tampered way easier. Quote Link to comment https://forums.phpfreaks.com/topic/154792-question-about-passing-values/#findComment-814153 Share on other sites More sharing options...
tefuzz Posted April 20, 2009 Author Share Posted April 20, 2009 Whoever uses a session that expires before a form can be filled out is an idiot. Your session will last. Hidden fields can be tampered way easier. how can I make sure the session will last long enough for the user to fill out all 6 pages of the form? Quote Link to comment https://forums.phpfreaks.com/topic/154792-question-about-passing-values/#findComment-814156 Share on other sites More sharing options...
teynon Posted April 20, 2009 Share Posted April 20, 2009 Unless someone changed the session time out in your php.ini, you will be fine. If you have access, look at the php.ini for session.gc_maxlifetime Quote Link to comment https://forums.phpfreaks.com/topic/154792-question-about-passing-values/#findComment-814158 Share on other sites More sharing options...
tefuzz Posted April 20, 2009 Author Share Posted April 20, 2009 Unless someone changed the session time out in your php.ini, you will be fine. If you have access, look at the php.ini for session.gc_maxlifetime no access to php.ini :-\ Quote Link to comment https://forums.phpfreaks.com/topic/154792-question-about-passing-values/#findComment-814246 Share on other sites More sharing options...
meomike2000 Posted April 20, 2009 Share Posted April 20, 2009 you should be able to use the session with out time out unless they take like 20 mins or more to fill it out,,, wouldnt understand why sesseions wouldnt at least last that long... mike.... Quote Link to comment https://forums.phpfreaks.com/topic/154792-question-about-passing-values/#findComment-814257 Share on other sites More sharing options...
PFMaBiSmAd Posted April 20, 2009 Share Posted April 20, 2009 The session.gc_maxlifetime can be set anywhere - master php.ini, .htaccess file (when php is running as an Apache module), httpd.conf (Apache only), a local php.ini (when php is running as a CGI application), or even in your script, as long as it is set before every session_start() statement. The session.gc_maxlifetime setting in effect when session garbage collection runs, will determine the age of the session data files that are deleted. On a shared web server using the default session.save_path, the shortest session.gc_maxlifetime setting wins. To insure that only your session.gc_maxlifetime setting affects your session data files, you must set your session.save_path to be to a folder within your accounts folder tree. Quote Link to comment https://forums.phpfreaks.com/topic/154792-question-about-passing-values/#findComment-814260 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.