Forums

PHP

This topic is locked

displaying images

Posted 03 Feb 2005 21:06:10
1
has voted
03 Feb 2005 21:06:10 Mike Norman posted:
Dear All,

I am utilising a php to populate a page with images.

I have a variable that changes due to the item selected.

At present if there is no image present, IE displaya an ugly box, Firefox displays the alt text.

What code can I use to check to see if there is an image present, and if not leave the field blank?

Thanks in anticipation of an answer.
Mike Norman

www.nord-charente-homes.com

Replies

Replied 03 Feb 2005 21:51:39
03 Feb 2005 21:51:39 Chris Charlton replied:
Are you using a database?

Assuming you are using a database, you can do an <i>if</i> condition and see if the record is either <i>NULL</i> or empty/blank ("". Those would be the first things to try.
Replied 03 Feb 2005 22:10:46
03 Feb 2005 22:10:46 Mike Norman replied:
Hi,

I'm not using a database for the images, can I check whether the file requested is null?
Replied 04 Feb 2005 03:49:21
04 Feb 2005 03:49:21 Chris Charlton replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>I'm not using a database for the images, can I check whether the file requested is null?<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Yes, www.php.net/manual/en/function.is-file.php

~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>

Reply to this topic