Josh Close wrote:
So basically there is no easy way around this.
What I'm trying to do is have a page return to a page that was a couple pages back with the same get info. On the second page I can do
$return_url = $_SERVER['HTTP_REFERER'];
to get the previous url. But then I need to pass it on to the next page, then that page will return to the $return_url.
I think passing via $_SESSION vars or cookies would be easier then doing actual socket posts.
If there is an easier way than session or cookies to do this, I'd like to know.
-Josh
It's super easy, actually. There's been a wee bit of code floating around the mailing list for 5 or so years for this:
function PostToHost($host, $path, $data_to_send) { $fp = fsockopen($host,80); fputs($fp, "POST $path HTTP/1.1\n"); fputs($fp, "Host: $host\n"); fputs($fp, "Content-type: application/x-www-form-urlencoded\n"); fputs($fp, "Content-length: ".strlen($data_to_send)."\n"); fputs($fp, "Connection: close\n\n"); fputs($fp, $data_to_send); while(!feof($fp)) { echo fgets($fp, 128); } fclose($fp); }
Just modify to suit and you're good to go. Note: you need to URL-encode the data you send into a string before passing it to the above function.
Hope this helps,
Torben
-- Torben Wilson <[EMAIL PROTECTED]>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php