creativeforces Posted July 26, 2008 Share Posted July 26, 2008 Hello, I am sorta new to PHP and new to the forum. I have a form that I am submitting to a database and doing error checking via PHP first. Everything is working right now on the form, but...I want to make a review page for the user after submitting the form. So what I have done is set the form action to the review page (review.php) and then I am grabbing the post data on the review page and echoing it out for the user to see. I can't seem to get the error checking to happen on the form page first, to validate everything...and then have it go to the review page. So, the flow I am looking for is: user fills out form, hits submit, then the form validates, if there are errors they are displayed on the form page, if not then the form is directed to the review page where I grab the data and echo it out and then the user submits the data if it is correct. Krop.com has an example of exactly what I am trying to do on their site when you create a new job: https://www.krop.com/jobs/step1_configure. You can fill in the form, it won't save on their site. Thanks for the help. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 26, 2008 Share Posted July 26, 2008 Store the data in a session. Quote Link to comment Share on other sites More sharing options...
creativeforces Posted July 26, 2008 Author Share Posted July 26, 2008 Ahhh Sessions, I did not think of that, thanks for the tip. OK, I have that setup, but the other thing I can't get to work is I don't understand how to perform my error checking and then go to the review page. So on the form page, If I have the form action set to review.php, then it skips my error checking and I want the data to validate before it goes over to the review page. I tried something like this, setting the form action to echo $page, but it didn't work: if (!empty($errors)) { $page = "new.php"; } else { $page = "review.php"; } Quote Link to comment Share on other sites More sharing options...
creativeforces Posted July 28, 2008 Author Share Posted July 28, 2008 I guess my question is how do you make a form submit to itself until all of your server side error checking is done, then submit to another page? Any tutorials on this or advice? Thanks Quote Link to comment 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.