| 
 Posted by darthmincho on 06/14/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] 
 |