Re: fsocketopen not returning data properly

From: Date: Tue, 19 Jun 2007 19:33:53 +0000
Subject: Re: fsocketopen not returning data properly
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-257458@lists.php.net to get a copy of this message
On 6/19/07, Dan <frozendice@gmail.com> wrote:
I got the function from the web, the implementation I did myself, echo httpSoc... Maybe I'm not using the function right because I keep getting a fatal error of: Fatal error: Call to undefined function logEventToTextFile() on line 79 Does it look like I'm implementing the code correctly? And I tried with GET, I get the same error. - Daniel
Hi, It seems that you copied only a part of the code, and that you didn't copy the code of that self-made function. You can remove these lines: logEvent('debug', 'Failed opening http socket connection: '.$errorString.' ('.$errorNumber.')<br/>\n'); logEventToTextFile('debug', $chunk_length); logEventToTextFile('debug', $responseContent); Tijnema
"Tijnema" <tijnema@gmail.com> wrote in message news:d8269d910706190034t600429aeg771e173301d4fce5@mail.gmail.com... On 6/19/07, Dan <frozendice@gmail.com> wrote:
I'm having trouble with sockets in PHP, if anyone has the time to help out that would be awesome. I am trying to get the result of a post
There are a lot of people that are probably willing to help, but what is your exact problem?
echo httpSocketConnection("www.google.com", "POST", "/search", "q=test", "80"); This should post to google.com with a query of test. Then give me the response. The function I'm using is below.
Google doesn't wants a POST request, make it a GET request and it should work.
Here's the function's code:
<snip> You copied this straight from the web? If so, then there are probably no bugs in it. Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#257458) next »