file_exists takes a string argument. /images/$filename is not a string. try "images/" . $filename instead.
Fred Prolog <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > 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: > > > ---------- > > file://filename is the item number + t.jpg -- t shorthand for thumbnail > > $itemnumber = "$myrow[item_number]"; > $filename = "$itemnumber t.jpg"; > > echo "<tr><td><center>"; > > file://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 > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]