Re: Relocating and POSTing

From: Date: Thu, 10 Jul 2008 19:37:11 +0000
Subject: Re: Relocating and POSTing
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-276624@lists.php.net to get a copy of this message
Daniel Brown wrote:
On Thu, Jul 10, 2008 at 2:32 PM, Richard Heyes <richardh@phpguru.org> wrote:
1. Use the query string. Eg header('Location: http://www.xxx.com?name=value&name2=value2');
    That's GET, not POST, as the subject requests.  ;-P
2. Use sessions
    .... if you're not trying to POST the data and are staying within
the same domain on the same server. ;-P
With all that in mind, if you must POST then you can do something like this: $data = addslashes("yourvar=$yourdata&secondvar=$moredata"); //just like get header('POST /some/path/to/somefile.php HTTP/1.1'); header('Host: www.example.com'); header("Content-Type: application/x-www-form-urlencoded"); header("Content-Length: " . strlen($data)); header($data); -Shawn

« previous php.general (#276624) next »