Re: Relocating and POSTing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shawn McKenzie wrote:
Daniel Brown wrote:
On Thu, Jul 10, 2008 at 2:32 PM, Richard Heyes <richardh@xxxxxxxxxxx> 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

Have you tried it? I very much doubt that would work, considering neither GET nor POST are valid in a RESPONSE (which is what you're sending), they're only valid in REQUEST headers (which you're not in right now, that's the browser's domain)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux