Jump to content

Archived

This topic is now archived and is closed to further replies.

adgold

Phantom path

Recommended Posts

I'm using PHP to display information from a MySQL database about various issues of a (paper) magazine. GIF thumbnails and PDF proofs of each page are stored like so:
/0605/gif/0605_001.gif . . . 0605/gif/0605_999.gif
and
/0605/pdf/0605_001.pdf . . . 0605/pdf/0605_999.pdf

This works fine for all the issues I have online -- I get a GIF thumbnail and a link to the PDF in my PHP-generated report.

However, I have older info in the database for which no GIFs, PDFs, or directory structure exists. In those cases, my PHP-generated report will substitute its best guess for what I'm looking for. For example, a call to 0405_001.gif gives me an image and link for 0605_001 . . . when I would have expected (and preferred) a missing image and a broken link. This happens in both IE and Firefox.

I don't even know if this is a PHP problem, but the smartest people in the world read these forums, so anyone know what's going on here?/

Share this post


Link to post
Share on other sites
do a check to see if it exists, like for example this:
[code]
if(file_exists("path/icon.gif"))
{
print "<img src=\"path/icon.gif\" alt=\"icon\" />";
}
else
{
print "This file does not exist..";
}
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.