|
Posted by sree on 08/18/06 05:30
Hi,
No probs. I got the solution for this.
that is,
<?php
$TheImage = "http://www.uk-present.co.uk/images/logo.gif";
if (@fclose(@fopen("$TheImage", "r"))) {
$TheImage = "$TheImage";
}
else {
$TheImage = "http://www.uk-present.co.uk/images/120x60-noimage.gif";
}
?>
The first if loop tells you that the image exist, else it does not
exist
However it works only when the server gives you 404 error
Chung Leong wrote:
> sree wrote:
> > Hi,
> >
> >
> > i want to check whether a file from remote server is existed or
> > not.
> >
> > The file_exists() checks for local server only. But i want a function
> > that checks the remote server.
> >
> >
> > If anyone knows please help..
> >
> > thanks in advance...
> >
> > regards
> > sree
>
> This will do the trick:
>
> if(@fopen($url, "rb")) {
> }
[Back to original message]
|