Code: Select all
<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
// build our request
$r = <<<REQ
POST /test/ping/ping.php?id=5 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 4096
foo=bar&name=Tom+Smith&what=nothing
REQ;
// connect
echo '<h1 style="color: #0A0;font-family:Verdana;">Pinging site...</h1>';
$fp = fsockopen('http://'.$_SERVER['HTTP_HOST'],80);
if ($fp)
{
fputs($fp,$r);
// get response
while (!feof($fp))
{
$res .= fgets($fp,128);
}
echo $res;
fclose($fp);
}
?>Code: Select all
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: No address associated with nodename in /Users/kylebragger/Sites/test/ping/index.php on line 15
Warning: fsockopen(): unable to connect to http://pcp01770159pcs.audubn01.nj.comcast.net:80 in /Users/kylebragger/Sites/test/ping/index.php on line 15Thanks,
Kyle Bragger