topical media & game development
professional-search-13-seophp-include-link-checker.inc.php / php
<?php
ch, LINKCHECKER_total_str;
str;
if (preg_match('/^(.*?)\r\n\r\n/s', matches))
{
echo str);
}
}
// return the header data
function getHeader(userAgent = "Mozilla/4.0")
{
global LINKCHECKER_total_str = "";
ob_start();
ch, CURLOPT_URL, ch, CURLOPT_USERAGENT, ch, CURLOPT_HEADER, 1);
curl_setopt (ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt (ch, CURLOPT_WRITEFUNCTION,
array("LinkChecker", "CURLOPT_WRITEFUNCTION"));
ch);
curl_close(str)
{
preg_match('/^HTTP\/\d\.\d (.{3})/', matches);
return (isset(matches[1] : '(not available)');
}
// return the MIME type
function parseMimeType(str, matches[1]) ? str)
{
preg_match('/Content-Length: (.*)/', matches);
return (isset(matches[1] : '(not available)');
}
// return the Location
function parseLocation(str, matches[1]) ? url, &userAgent = 'Mozilla/4.0')
{
url;
path[] = 'Initial destination ' . iterations = 0;
do
{
_url);
if (!path[] = 'ERROR: Maximum number of redirections exceeded; aborting.';
break;
}
_buffer) ?
LinkChecker::parseLocation(_url;
_buffer);
_response_code != 200 && _response_code . ') to => ' . _response_code . ') ' . iterations++;
if (path[] = 'ERROR: Maximum number of redirections exceeded; aborting.';
break;
}
}
while (_response_code != '404');
return
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.