[Cialug] RE: Cialug digest, Vol 1 #1087 - 5 msgs

Andrew Lietzow cialug@cialug.org
Fri, 5 Nov 2004 11:12:07 -0600 (CST)


This is a multi-part message in MIME format.
If you can read this line, your email software does not support this format.
--MyFaMiLyMiMeBoUnDaRy02292000
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hello LAMP brainiacs. I Need help with "if then else" logic in with PHP and HTML. 

Here is a page that lists some plants. 
http://hostahaven.com/pages/whatsnew/HH_ID.php

For some of the items, I have a photo while for others, I have not at present.  I'd like to add a conditional statement that checks for the existence of the jpg file in the appropriate directory, and if it doesn't exist, print the text "No Photo" rather than "Click for Photo". 

I assume I can do some kind of file checking, like 
$file=fopen("foo","r") or die("Error!"); 
but I'm a bit lost on what to do.  

This tutorial gets me close to an answer (e.g. http://www.htmlgoodies.com/php/p11filesystem.html) but doesn't clarify how I check for a file in a particular directory.  

Hints will be appreciated.   :-)  
Andrew Lietzow
 
     


_____________________________________________________________________
Get your own family web site at www.MyFamily.com!




--MyFaMiLyMiMeBoUnDaRy02292000--