Re: Scrubbing URL's

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

 



Hi,

You can also do this using the following code:

$fh = @fopen($url, "r");
if ($fh)
{
    fclose($fh);
}
else
{
    echo "URL ($url) doesn't exists";
}

This does work for the HTTP code 200 and 400. I am not sure how it handles the redirects Code 302.

Regards,

Amit Arora
www.digitalamit.com

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.


TIA!

--
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