PHP using an HTML template
<p>I am having trouble reading in a file and using it as a template in PHP. A portion of my code is pasted below. For some reason it never finds $$USER_NAME$$ in the string so it never replaces. I also pasted the beginning part of my template below. </p>

<pre><code>$filename = "email/templates/welcome.txt";
$file = fopen($filename, "r")   
$body = fread($file, filesize($filename));
fclose($file);
$body = str_replace("$$USER_NAME$$", "John Doe", $body);
print($body);
</code></pre>

<p>Template: </p>

<pre><code>&lt;p&gt;
   &lt;img src="emailPic" alt="Logo" /&gt;
&lt;/p&gt;
&lt;p&gt;Dear $$USER_NAME$$,&lt;/p&gt;
&lt;p&gt;Thank you for registering to attend $$EVENT_NAME$$. We look forward to helping you reach your networking goals at $$EVENT_SHORT_NAME$$.
&lt;/p&gt;...
</code></pre>

<p>Any ideas about why it wouldn't find $$USER_NAME$$ in the template?</p>
