Re: Scrubbing URL's

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul Nowosielski wrote:
Dear All,

I have 150,000 + URLS I need to validate. When I say validate, I mean I would like to verify the URL opens up a web page that returns a '200' and not a '404'.

I was thinking of first verifying the host has a DNS A record by using checkdnsrr().

Then using CURL to check server response.

Does any one know of a function or class that already does this? Your thoughts would be greatly appreciated.

I don't think anyone has done something this specific but it'd be reasonably easy to do.

cURL would definitely be your best bet because it's the most flexible..

To handle 302's use the CURLOPT_FOLLOWLOCATION option.

To handle bad pages (400+ error codes), use CURLOPT_FAILONERROR.

I'm sure you've seen it but a list of available options and what they do are here: http://www.php.net/manual/en/function.curl-setopt.php

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux