Rob Rob - 24 days ago 9
PHP Question

php_network_getaddresses: getaddrinfo failed: Name or service not known

Here is a snippet of my code

$fp = fsockopen($s['url'], 80, $errno, $errstr, 5);
if($fp){
fwrite($fp, $out);
fclose($fp);


When I run it, it outputs:


unable to connect to www.mydomain.net/1/file.php:80 (php_network_getaddresses: getaddrinfo failed: Name or service not known


I can't figure out why. Any help would be greatly appreciated.

EDIT: I forgot to mention that I'm using this to submit GET data to the
$s['url']

Answer

If you only want to submit GET data to the URL, you should use something straightforward like file_get_contents();

$myGetData = "?var1=val1&var2=val2";
file_get_contents($url.$myGetData);
Comments