Posted By

Tamedo on 01/25/08


Tagged

files


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

MoFu
oriolfb


Get all files from a folder for form


 / Published in: PHP
 

  1. <form method="POST" name="imageForm">
  2. <select name="images">
  3. <?
  4. $handle=opendir('../images/');
  5. while (false!==($file = readdir($handle))) {
  6. if ($file != "." && $file != "..") {
  7. echo "<option value=\"$file\">$file - ".filesize("../images/$file")." bytes</option>\n";
  8. }
  9. }
  10. closedir($handle);
  11. echo "</select>";
  12. ?>
  13. </form>

Report this snippet  

You need to login to post a comment.