Re: Pass Form POST details to redirects via Header("location: nextpage.php") or any way possible
| From: | Rasmus Lerdorf | Date: | Sun, 20 Oct 2002 21:54:06 +0000 |
| Subject: | Re: Pass Form POST details to redirects via Header("location: nextpage.php") or any way possible | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120689@lists.php.net to get a copy of this message | ||
> This works fine when on GET but when I changed it to POST I cant seem to
> find a way to pass the POST information to the next page with
> Header("Location: newurl.php";)
>
> Basically I need to use POST because GET doesn't allow enough data for the
> auction site I am developing [in-between studying, for a client [at
> www.bids.captive.co.nz ]].
>
> Any information on how to POST the data between pages would be appreciated.
Chances are you are taking the wrong approach here. If you are
redirecting to the same server, why not just pass some sort of identifier
in the GET request and then use that to fetch the associated data? If you
have a lot of data, passing it across the wire back and forth between the
server and the client is a really bad idea. This sort of data id is
essentially what a session is. So you could simply use the built-in PHP
session support.
If you need to post to a remote host somewhere directly from within PHP,
you can fsockopen() to port 80 and fputs() the appropriate request and
POST data. If you search around for a function called PostToHost you will
find a little example I wrote years ago to show you how to do it.
-Rasmus