<select name="s1"> <option value="" selected="selected">-----</option> <?php foreach(glob(dirname(__FILE__) . '/txt/*') as $filename){ $filename = basename($filename); echo "<option value='" . $filename . "'>".$filename."</option>"; } ?> </select> <form action="save_selected.php" method="post"> <input type="submit" name="myfile" value="ok" /> </form>
<?php var name = document.getElementById("myText").value; $myfile = fopen("newfile.txt", "w") or die("Unable to open file!"); $txt = $filename; fwrite($myfile, $txt); fclose($myfile); ?>
document.getElementById
<select>
<form>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)