Jump to content

Recommended Posts

Your description is a little vague as to what you are doing and what you are wanting to accomplish. But, what I *think* you are doing is having two input forms that the user accesses in succession: Form1 - Form2. Then you want to go where? Form1 or Form2?

 

Without further clarification I cannot be very specific, but here is a general idea of how you could handle it:

 

Form1 should submit to itself. If the data does not pass validation then it should reshow the form with the posted data populated in the form. If the data does pass validation, then have Form1 do an include of Form2 (but do not have any input from the Form1 page)

 

Form2 will load with all the Form1 data avaialble as post data. You could then display the Form2 fields and then for the Form1 data you could do a couple of things: 1) populate hidden fields with the Form1 data so when Form2 is submitted all the information is sent as POST data, or 2) save the Form1 data as session data and then the processing page could access Form2's data as POST data and Form1's data as session data.

 

Personally I would go with option 1 and you could easily automate that with a small loop on Form2 like this:

foreach ($_POST as $key => $val) {
  if ($key != 'submit') {
    echo "<input type=\"hidden\" name=\"$key\" value=\"$val\">";
  }
}

Link to comment
https://forums.phpfreaks.com/topic/51703-return-page/#findComment-254751
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.