|
Posted by Pete on 05/21/06 19:12
I'm sure the answer is simple, but the solution is eluding me-I'm
not too good at the particulars of scripting. Maybe someone can point
me on the right path...
Here is the problem:
I have a string of php code that retrieves an image, in this case, an
image of a book cover from Amazon.com. This works perfectly well,
unless, there isn't an image of the book on Amazon's server. When
there's no image, a blank hole appears on the final page. What I
would like to happen is, if the variable for the image isn't met
(i.e. no book cover image), a "No Image" image, from my server,
will load in its place.
Here is the code that retrieves the image:
<img border="0" src=<? echo $i['ImageUrlSmall'];?>>
Is there a way to include a command that will retrieve an image from
http://www.mysite.com/images/noimage.gif if the first condition is not
met?
If anyone can help me, I'd be grateful.
--Pete
Navigation:
[Reply to this message]
|