Jump to content

PHP syntax


brettpower

Recommended Posts

That is exactly what i need,  however, I can't get the syntax right.

[code]<?php
$filename = ../uploads/xxxxxx.gif';

if (file_exists($filename)) {
  echo "";
} else {
  echo "";
}
?>  [/code]

I have an existing variable ( $row_Upload['campaign'] ) that pulls a campaing ID number that is used on several parts of the page.  The file that I want to verify the existance of is simply the variable with .gif added onto the end.  I can't figure out how to plunk my existing variable into line 1 of the above code with .gif on the end to get the code to work.

Also, if the file does exist, I want a hyperlink to ../uploads/xxxxxx.gif, and if the file is not found, a hyperlink to ../file_upload.php.

If anyone understands what the heck I need, please help.

Thanks.
Link to comment
https://forums.phpfreaks.com/topic/34618-php-syntax/#findComment-163264
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.