I am calling an IIS XP server from a .php script located on a different server. When I try to open a post page from PHP, I get the following error:
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/mylocal/test.php on line 9
The URL i am trying to open is an IP address of my IIS server using a cable modem. This may be a permissions problem but I cant identify if it is or not. I know that the IP for my IIS is correct, it's just that the php statement cant find it. Here is the code:
$host = 'http://111.222.333.444'
$port = 80;
$timeout = 10;
$uri = '/test.asp';
$postData = "product_name=product1";
$length = strlen($postData);
$socket = fsockopen($host, $port, $errno, $errstr, $timeout);
echo '$errstr ($errno)<br>\n';
// do something
If anyone wants the actual addresses to help me, let me know. I will email it.