// second selection for main image on main page
$dir_name = "/path/to/images/directory/";
$dir = opendir($dir_name);
$file_lost .= "<p><FORM METHOD=\"post\" ACTION=\"done.php3\" NAME=\"ad01\">
<SELECT NAME=\"images\">";
 while ($file_names = readdir($dir)) {
  if ($file_names != "." && $file_names !=".." && eregi('_[0-9]{4}.jpg$',
$file_name)) {
  $file_lost .= "<OPTION VALUE=\"$file_names\"
 $file_lost .= "</SELECT><br><br><INPUT TYPE=\"submit\" NAME=\"submit\"

My problem is with the eregi() function to filter out files without the
following criteria *_4444.jpg, it must have an underscore followed by 4
numbers and then ending in .jpg file extension.  I have tried a few
different methods to try and get this to work however I think I am missing
something.  All of the documentation I have read on php.net states that this
string should work as is... I have checked the contents of the directory and
I only have files of these two types...
Could anyone enlighten me on how this is not working?
Thanks in advance,

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to