Jump to content

file_exists() and &


DarkPrince2005

Recommended Posts

Hi Guys

 

I have a piece of code that  checks if a file exists in a location, and if it does to then display a specific icon.

 

The problem I'm having is that the file does exist but my code says it doesn't. The file name contains an & character.

 

Any solutions????

 

if(file_exists('quotes/'.htmlentities($row["Quote_ID"]).'-'.htmlentities($row["Client"]).'-'.htmlentities($row["QuoteRevision"]).'.pdf')){
						 echo '<a href="quotes/'.htmlentities($row["Quote_ID"]).'-'.htmlentities($row["Client"]).'-'.htmlentities($row["QuoteRevision"]).'.pdf" target="_blank"><img src="images/icons/pdf.png" border="0" title="View File" /></a>';
						 } else {
						 echo '<a href="quote_pdf.php?id='.htmlentities($row["Quote_ID"]).'&cid='.htmlentities($row["Client"]).'&rev='.htmlentities($row["QuoteRevision"]).'&redirect=quote_list"><img src="images/icons/pdf_inac.png" border="0" /></a>';
						 }

Link to comment
https://forums.phpfreaks.com/topic/266086-file_exists-and/
Share on other sites

Archived

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

×
×
  • Create New...

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.