adgold Posted May 6, 2006 Share Posted May 6, 2006 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.gifand /0605/pdf/0605_001.pdf . . . 0605/pdf/0605_999.pdfThis 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?/ Link to comment https://forums.phpfreaks.com/topic/9173-phantom-path/ Share on other sites More sharing options...
alpine Posted May 6, 2006 Share Posted May 6, 2006 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] Link to comment https://forums.phpfreaks.com/topic/9173-phantom-path/#findComment-33804 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.