<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
   <select name="template_choice">
    <?php 
$dir = "../email_templates/"; 




$dir = opendir ("../email_templates/");
        while (false !== ($file = readdir($dir))) {
                if (strpos($file, '.html',1)||strpos($file, '.php',1) ) {
                    print "<option value=\"{$file}\">{$file}</option>"; 
                }
        } 



?>
  </select>
  <br/>
    <label for="subject">Subject of email:</label><br />
    <input id="subject" name="subject" type="text" value="<?php echo $subject; ?>" size="30" /><br />
    <label for="elvismail">Body of email:</label><br />
    <textarea id="elvismail" name="elvismail" rows="8" cols="40"><?php echo $text; ?></textarea><br />
    <input type="submit" name="submit" value="Submit" />
  </form>