Reply to Re: How to check remote file...

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация