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

Posted by darthmincho on 12/18/96 11:48

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

 

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

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