My PHP script uses http_post_fields() to make a post request to another server.
Here is an example of the code:
$g = http_post_fields("http://mysite.com", $some_array);
Though the script occasionally works, I often get this error:
http_post_fields() [function.http-post-fields]: couldn't resolve host name; name lookup timed out
I have now tried a variety of http addresses in the function, they all result in this error.
Does anyone know what the source of my trouble is?
Thanks for all the input Kasun. In the end, I got tired of this PECL library (where http_post_fields is defined) and I used cURL instead. The goal I’m reaching for here, is to request a security ticket from 1 server to another. Of course, the whole module works smoothly, now that I’m using cURL. Thanks again.