This is my first time playing with PHP, and I'm having trouble making a basic if/then statement. I want to do something like
if file exists show the html code else show different html code.
Here's where I'm at currently --
<?php
if ( file_exists('pdf/'.'htmlspecialchars($_POST['apt'], ENT_COMPAT)'.'.pdf') {
echo "the file exists";
} else {
echo "file does not exist";
}
?>
I think the problem here is how I wrote the
file_exists('pdf/'.'htmlspecialchars($_POST['apt'], ENT_COMPAT)'.'.pdf')
Thoughts greatly appreciated!
'? And also you are missing a closing)from theif ()statement.