file_exists problems

From: Date: Sat, 01 Dec 2001 07:12:38 +0000
Subject: file_exists problems
Groups: php.general 
Request: Send a blank email to php-general+get-76296@lists.php.net to get a copy of this message
I had a script that was running beautiful that simply called up a database and displayed the results in tables. I went to add images to this script and all hell broke loose. This is the portion of the script that I added: ---------- //filename is the item number + t.jpg -- t shorthand for thumbnail $itemnumber = "$myrow[item_number]"; $filename = "$itemnumber t.jpg"; echo "<tr><td><center>"; //if the file exists then print it. Otherwise print a generic image saying it doesn't exist. if(file_exists(/images/$filename)) { readfile(/images/$filename); } else { readfile(images/npat.jpg); } --------- Is there anything I need to know about "file_exists" that I'm not doing. for some reason when this code is added it gives me an error on the line after the close of the else statement. That line was perfectly fine before the addition. Please help. -Jordan

« previous php.general (#76296) next »