Hey guys,
I'm trying to write a scrpit that goes out and checks if a file is there. If it is, display this. If its not, display that. It seems pretty simple to do it but it seems like its not checking if the file exists. Note: It checks a file on a different domain.
Here is my code. I dont know whether or not i have to check if the url exists.
$pic_file = 'http://www.othersite.com/$url.jpg';
if (file_exists($pic_file)) {
echo "<img name=\"Pic\" src=\"$pic_file\" width=\"80\" height=\"100\" alt=\"$url\" />";
}
else {
echo "<img name=\"Pic\" src=\"http://www.mysite.com/default.jpg\" width=\"80\" height=\"100\" alt=\"$url\" />";
}
Any Help would be great! Thanks!