Re: [PHP] HTTP_POST Intermittent Problem

2004-08-26 Thread Matt M.
 function http_post($host, $path, $data)
 {
   $http_response = '';
   $content_length = strlen($data);
 
   $fp = fsockopen($host, 80);
   fputs($fp, POST $path HTTP/1.1\r\n);
   fputs($fp, Host: $host\r\n);
   fputs($fp, Content-Type: application/x-www-form-urlencoded\r\n);
   fputs($fp, Content-Length: $content_length\r\n);
   fputs($fp, Connection: close\r\n\r\n);
   fputs($fp, $data);
   while (!feof($fp))
   {
$http_response .= fgets($fp, 128);
   }
   fclose($fp);
 
   return $http_response;
 }
 
 $http_response = http_post('www.blah.com', '/test.aspx?', 'data');

can you use PEAR?

There is already a bunch of http packages

http://pear.php.net/package-search.php?pkg_name=httpbool=ANDsubmit=Search

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



RE: [PHP] HTTP_POST Intermittent Problem

2004-08-26 Thread Jay Blanchard
[snip]
I'm using the code below and about a third of the posts aren't getting 
through. We have no idea why and don't know where to start to trouble 
shoot. Any ideas? Thanks.
[/snip]

Have you checked the http access and error logs?

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



Re: [PHP] HTTP_POST Intermittent Problem

2004-08-26 Thread Jeff Oien
Jay Blanchard wrote:
[snip]
I'm using the code below and about a third of the posts aren't getting 
through. We have no idea why and don't know where to start to trouble 
shoot. Any ideas? Thanks.
[/snip]

Have you checked the http access and error logs?
On their end? Yes they can see each attempt to post and some that should 
have been posted (we know because we get confirmation email) didn't show 
up at all on their end. If it's on my end what would I look for? Thanks.
Jeff

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


Re: [PHP] HTTP_POST Intermittent Problem

2004-08-26 Thread Jeff Oien
Matt M. wrote:
can you use PEAR?
There is already a bunch of http packages
http://pear.php.net/package-search.php?pkg_name=httpbool=ANDsubmit=Search
I've taken a look at that and don't know the first thing about how to 
implement or use it. Are there any tutorials out there? Plus, I don't 
know if this would solve the problem.
Jeff

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