JavaScript Editor Ajax software     Free javascripts 



Main Page

?>
</body>
</html>
3.
It’s showtime! Feel free to change the value of the
$url
variable in
check_links.php
if you
want to check another URL, then load
http://seophp.example.com/check_links.php
.
The output should look like the one in Figure 13-3.
Figure 13-3
Figure 13-3 shows various data that the link library could provide about the input URL,
http://
www.cristiandarie.ro/pages/seophp.aspx
. As you can see, this URL does a 301 redirect to
http://www.cristiandarie.ro/seo-php/
.
Basically, all you’re usually interested in is the final status code reached by this page. If it’s 200, then the
link is valid. This is the code that retrieves the last status code:
// stablish the URL to analyze
$url = “
http://www.cristiandarie.ro/pages/seophp.aspx
“;
// obtain redirection path
$path = LinkChecker::getPath($url, $responseCode);
// display the HTTP status code of the last request
echo ‘Final status code: ‘ . $responseCode . ‘<br />’;
258
Chapter 13: Coping with Technical Issues
c13.qxd:c13 10:45 258


JavaScript Editor Ajax software     Free javascripts