Forum Moderators: coopster
Method 1:
if (@fclose(@fopen("$burl", "r")))
Method 2:
if (file_exists($$burl))
Method 3:
if ($img = @GetImageSize("$burl"))
where $burl is an absolute URL to an image.
Methods 1 and 3 seem to return the same result, but Method 2 (as per the PHP Manual) always seems to return a "not found".
However, the strange thing is that all three methods sometimes return a "not found", even when the image does exist. For example, here's such a banner:
[is1.example.com...]
Is this because this banner is actually returned by some code on the the hosting server, and if so, is there any way around this (other than trying to copy the banner to my own server - although in this particular case, I can't do that either)?
(The reason I need it is that I have about 280 banners in rotation across several of my websites, and I have written a program that will check them all, switching them off or on as required, and emailing the results to me. If I can't find a consistent and accurate method of finding whether the image is currently working or not, I may have to go back to checking them all manually.)
Thanks,
Mark.
[edited by: coopster at 1:48 pm (utc) on Mar. 30, 2006]
[edit reason] generalized url TOS [webmasterworld.com] [/edit]
[webmasterworld.com...]
[edited by: jatar_k at 5:39 am (utc) on Mar. 30, 2006]
[edit reason] fixed link [/edit]