Andrew Lietzow on Fri, 05 Nov 2004 11:13:04 -0600


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

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


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!