Guys & Gals,
I am trying to write a script which gets all of the external links on my site, then visits them to check that they are all valid. The problem is that the script only works for certain sites and doesn't work for sites that I know are OK. The code is below, can anyone help ?
$fp1 = fsockopen( "$host", 80, &$errno, &$errdesc, 10);
print "Trying $host<br>\n";
if ( ! $fp1)
{
print "Couldn't connect to $host:\n<br>Error: $errno\n<br>Desc: $errdesc\n";
print "<br><hr><br>\n";
continue;
}
print "Trying to get $page<br>\n";
fputs( $fp1, "HEAD $page HTTP/1.0\r\n\r\n" );
print fgets( $fp1, 1024 );
print "<br><hr><br>\n";