Re: Opening a socket and sending GET data

From: Date: Sat, 23 Nov 2002 01:05:27 +0000
Subject: Re: Opening a socket and sending GET data
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-125697@lists.php.net to get a copy of this message
Chris - Before PHP 4 came out, I needed to branch to a page from within the code (I know you can now cache the page). So, I have many applications out there using my POST version which has work flawlessly. Then I decided that in some cases, I would like to use the GET (saves me checking to see if the variables are either POST or GET). Here is how I call the POST and GETS. The use of "bounce" comes from my experience using WebHub, an NT based system for high performance. /* Bounce to a page using POST */ function bounce_post($server, $path, $url, $page, $info) { $http = new http; $fp = $http->http_fpost($server, $path . $page, $info); if($fp) {
     print '<BASE HREF="' . $url . $page . '"><p>';
     fpassthru($fp);
}; } /* Bounce to a page using GET */ function bounce_get($server, $path, $url, $page, $info) { $http = new http; $fp = $http->http_fget($server, $path . $page, $info); if($fp) {
     print '<BASE HREF="' . $url . $page . '"><p>';
     fpassthru($fp);
}; } Chris Shiflett wrote:
Your request looks fine. What are you doing with $query once you have constructed it? Another question worth asking is what is your ultimate goal here? I'm not sure performing a manual request is necessary, but maybe it is. Chris --- Todd Cary <todd@aristesoftware.com> wrote:
# now we build our query $query = "GET $abs_url" . "HTTP/1.0\r\n" . "Accept-Language: en-us\r\n". "Host: $host:$port\r\n". "Connection: close\r\n";
-- Ariste Software, Petaluma, CA 94952

« previous php.general (#125697) next »