I am currently trying to detect whether a file exists where I am uploading a file to via a web form but I am having trouble trying to get the string right. At the moment I have:
$filename = '/uploads/$destination_file';
if (file_exists($filename)) {
print "The file $filename already exists";
} else {
// upload the file
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);
}
The bit I am unsure about how to to is:
$filename = '/uploads/$destination_file';
Destination_file is set earlier in the script but I am not sure how to put it together so it checks in the uploads folder if that file exists. If anyone could help me out that would be great.