You are here: Retrieving an Image if Condition Not Met « PHP Programming Language « IT news, forums, messages
Retrieving an Image if Condition Not Met

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]


Удаленная работа для программистов  •  Как заработать на 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

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