How can I redirect and pass the POST data?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fred Weinhaus

    #1

    How can I redirect and pass the POST data?

    I would like to make a redirect and pass the POST data to the redirected
    page from the original page. What is the easiest way to do this? Can one
    do this by setting the header data in some way. If so, how? Is there a
    better way without using sessions. I am rather new to PHP. Thanks

    Fred Weinhaus
  • Carl Vondrick

    #2
    Re: How can I redirect and pass the POST data?

    Fred Weinhaus wrote:[color=blue]
    > I would like to make a redirect and pass the POST data to the redirected
    > page from the original page. What is the easiest way to do this? Can one
    > do this by setting the header data in some way. If so, how? Is there a
    > better way without using sessions. I am rather new to PHP. Thanks[/color]

    You need to use fsockopen to simulate this.

    However, if you want if to transfer contents from one page to another,
    just use sessions.
    [color=blue]
    > Fred Weinhaus[/color]


    --
    Carl Vondrick
    Professor of Computer Science at Columbia University, researching computer vision, machine learning, and AI applications.

    usenet [at] carlsoft [dot] net

    Comment

    • David Haynes

      #3
      Re: How can I redirect and pass the POST data?

      Fred Weinhaus wrote:[color=blue]
      > I would like to make a redirect and pass the POST data to the redirected
      > page from the original page. What is the easiest way to do this? Can one
      > do this by setting the header data in some way. If so, how? Is there a
      > better way without using sessions. I am rather new to PHP. Thanks
      >
      > Fred Weinhaus[/color]
      Chaining POST pages without SESSIONs may be done with GETs.

      page1.php grabs the $_POST array.
      When it wants to call page2.php, it converts the $_POST values to $_GETs
      by doing something like:

      $gets='';
      foreach($_POST as $key => $value) {
      $gets = ($gets == '') ? $key.'='.$value : '&'.$key.'='.$v alue;
      }
      header("Locatio n: page2.php?$gets ");

      page2.php would then grab the values via the $_GET array.

      -david-

      [UNTESTED] I think you can make pages POST/GET neutral through the
      REQUEST array. I keep reminding myself to poke around in REQUEST when I
      get some time.

      Comment

      • Richard Levasseur

        #4
        Re: How can I redirect and pass the POST data?

        $_REQUEST is the combination of get, post, cookie, in that order.

        Cookie overrides parameters specified via post/get
        Post overrides parameters specified via get

        Comment

        • Jerry Stuckle

          #5
          Re: How can I redirect and pass the POST data?

          Richard Levasseur wrote:[color=blue]
          > $_REQUEST is the combination of get, post, cookie, in that order.
          >
          > Cookie overrides parameters specified via post/get
          > Post overrides parameters specified via get
          >[/color]

          This depends entirely on the value in variable_order in your php.ini file.

          --
          =============== ===
          Remove the "x" from my email address
          Jerry Stuckle
          JDS Computer Training Corp.
          jstucklex@attgl obal.net
          =============== ===

          Comment

          Working...