Files showing up in terminal run, not in browser
<p>I'm trying to list the files in a directory, but only the HTML portion of the page shows up in my browser. When I run the page through the PHP terminal interpreter, all the files are listed with the proper HTML tags. </p>

<p>files.php:</p>

<pre><code>&lt;html&gt;&lt;head&gt;&lt;title&gt;Title&lt;/title&gt;&lt;/head&gt;

&lt;body&gt;

&lt;?php
   $currentdir = '/home/tim/Documents/Web/';
   $dir = opendir($currentdir);
   echo '&lt;ul&gt;';
   while ($file = readdir($dir)){
      echo "&lt;li&gt;$file&lt;/li&gt;";
   }
?&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
