JavaScript Editor Ajax software     Free javascripts 



Main Page

return $path;
}
}
?>
2.
In the
seophp
folder, create a file named
check_links.php
with the following code. This is a
simple script created to demonstrate the functionality of the
LinkChecker
class:
<?php
// include link checker library
require_once ‘include/link_checker.inc.php’;
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN”
“http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd
“>
<html>
<head>
<title>: Link Checker</title>
</head>
<body>
<h1>: Link Checker</h1>
<?php
// stablish the URL to analyze
$url = “
http://www.cristiandarie.ro/pages/seophp.aspx
“;
// retrieve URL data
$responseHeader = LinkChecker::getHeader($url);
$statusCode = LinkChecker::parseResponseCode($responseHeader);
$mimeType = LinkChecker::parseMimeType($responseHeader);
$contentLength = LinkChecker::parseContentLength($responseHeader);
$location = LinkChecker::parseLocation($responseHeader);
$path = LinkChecker::getPath($url, $responseCode);
// display URL request data
echo ‘URL: ‘ . $url . ‘<br />’;
echo ‘Response header: ‘ . $responseHeader . ‘<br />’;
echo ‘Response status code: ‘ . $statusCode . ‘<br />’;
echo ‘Response MIME type: ‘ . $mimeType . ‘<br />’;
echo ‘Response content length: ‘ . $contentLength . ‘<br />’;
echo ‘Response location: ‘ . $location . ‘<br />’;
// display the redirection path
echo ‘Path: <br />’;
for ($i = 0; $i < count($path); $i++)
{
echo ‘&nbsp;&nbsp;’ . $path[$i] . ‘<br />’;
}
// display the HTTP status code of the last request
echo ‘Final status code: ‘ . $responseCode . ‘<br />’;
257
Chapter 13: Coping with Technical Issues
c13.qxd:c13 10:45 257


JavaScript Editor Ajax software     Free javascripts