You are here: Re: Checking if an image exists on a remote server. « PHP Programming Language « IT news, forums, messages
Re: Checking if an image exists on a remote server.

Posted by frizzle on 12/17/56 11:48

darthmincho@gmail.com wrote:
> Hi.
> I want to check if an image exists on a remote server, and if it does,
> show it. I
> If it does not exist I want to show a default message. I have
> previously used these chunks of code but none of them have worked. Any
> Ideas?
>
> ------------------------
> $imgCheck=readfile("http.//www.somesite.com/image.gif");
> if($imgCheck) echo "<img border=0
> src=\"http.//www.somesite.com/image.gif\" width=\"550\" height=\"80\"
> alt=\"banner\">";
> -------------------------
> $fp = @fopen("http.//www.somesite.com/image.gif","r");
> if ($fp) {
> echo '<img border=0 src="http.//www.somesite.com/image.gif" width="550"
> height="80" alt="banner">';
> } else { echo 'Resource not valid'; }
> ------------------------
> Thanks ;o

Dunno if that's it, but in your code you have
HTTP.//
instead of
HTTP://

Frizzle.

 

Navigation:

[Reply to this 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

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