Hi folks. I've managed to piece together a php ping script that i THINK should work, but all urls that i ping, it says they are all down.
Here is the code, do you have any idea what's going wrong with it?
I can't link to a result page, because its my local test server, but check at the bottom for a dump of what it tells me.
<?php
//URL ARRAY
$links = array ("www.hammerslane.com","www.phpbuilder.com","www.linkynoworkyaaaaaaaaaa.com");
function chkuri($link)
{
$churl = @fopen("http://".$link,'r');
if (!$churl) {
return false;
}else{
return true;
}
}
foreach($links AS $link)
{
if(!chkuri($link))
{
print"$link is down<br><br>";
}
else
{
print"$link is up<br><br>";
}
}
?>
here is what it outputs...
www.hammerslane.com is down
[url]www.phpbuilder.com[/url] is down
[url]www.linkynoworkyaaaaaaaaaa.com[/url] is down
hammerslane.com is up, and obviously, so is phpbuilder.com, yet it says they're both down.
anyone have an idea?
many thanks 🙂