Jump to content

Review Page for form submission


creativeforces

Recommended Posts

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.

 

 

 

Link to comment
Share on other sites

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";
}

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.