I'm making a php page that displays and processes a form (by submitting the form to the same page) Afterward processing, I want to redirect to a second page, and pass along the same parameters.

What's the best way to do the redirect?

I don't want the parameters to show up on the URL, so I didn't use header("location: nextPage.php?key=value...blah, blah).

After processing the data, I then created a table with hidden inputs, then did a automatic submit to the second page. But when I press Back button to return to the first page, I keep getting redirected back.

I'm considering using cookies now, since the same parameters will be passed along to several pages.

Any suggestions?

    why do u want to auto redirect? there may be a better way of doing what ur trying to do. explain a litte more in detail of the project ur attempting and i'll try and give u some other ways of doing it, or ideas for redirecting...

      I have a form to let users submit personal information. Then I need to go through a DB to look up the user's past information.

      Then I need load a second page, containing some forms, along with user's data (past data too, if there were any)

      In the first page, I made a hidden field, called temp

      <?php
      if (!isset($temp)) {
      $sub = 0;
      }
      if ($sub == 1) {

        sorry, my finger slipped:

        if (!isset($temp)) {
        $sub = 0;
        }
        if ($temp == 1) {

        check DB

        redirect to 2nd page

        } else {

        show form

        make hidden field temp = 1

        }

          k, so... u'r first page asks for data in the forms.. then, on submit.. submits them to the dbase (autoincriment or w/e) then on second page retrieves that data posts it to that page, as well as retrieving any other data in the dbase that has already been submitted (behond the first page scope)

          thoughts:

          page1:
          setup form normally with this type of idea:

          on the form, have the action goto page2

          and on page2:

          if $_REQUEST['submitbutton'] == 'true' // sub button from pg1
          {
          submit all variables up to dbase, retreive any new data, then show page if no errors with all the stuff from the dbase
          }

          i think that will do what u want... :S

            Write a Reply...