PHP file_exists if/then statement
<p>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</p>

<p>if file exists
 show the html code 
else
 show different html code. </p>

<p>Here's where I'm at currently -- </p>

<pre><code>&lt;?php
if ( file_exists('pdf/'.'htmlspecialchars($_POST['apt'], ENT_COMPAT)'.'.pdf') {
    echo "the file exists";
}  else {
    echo "file does not exist";
}
?&gt;
</code></pre>

<p>I think the problem here is how I wrote the</p>

<pre><code>file_exists('pdf/'.'htmlspecialchars($_POST['apt'], ENT_COMPAT)'.'.pdf')
</code></pre>

<p>Thoughts greatly appreciated!</p>
