I've looked on this newsgroup on google and on php.net, but I can find
a work function which will allow me to check if a url exists?
Can anyone provide me with one?
or point we towards one?
Best regards,
Jules.
1) create a socket resource
2) connect to the socket on port 80
3) send the URL
4) read the response.
Check for errors on each of the steps above
I've had a few attempts and always come up with a 200 return code.
I guess 404 handling pages are causing this.
Jules.
<?php
$url = 'http://www.whatever.com/ccc';
$fp = @fopen($url, 'r');
if ($fp) {
$headers = stream_get_meta_data($fp);
print_r($headers);
}
> I've looked on this newsgroup on google and on php.net, but I can find
> a work function which will allow me to check if a url exists?
>
> Can anyone provide me with one?
> or point we towards one?
>
$skunk="http://www.emailuser.co.uk";
if (fopen($skunk,'r')===FALSE) {exit;}
Although it doesnt work if the website uses a custom 404 webpage and i
never got around to doing any more work on it .
--
Encrypted email address
www.emailuser.co.uk/?name=KRUSTOV
yes, i want to cater for custom 404 pages
:(
Jules.