Hi! Kevin!
Try this... :-) have a nica day!

<?
// this is qw.php
// is incoming parametr $catalog;
// there can be better way to protect filesystem

// directory where operations aloved
define("START_PATH",          "named");

$catalog =  eregi_replace('([/]{2,})|([./]{2,})|([/.]{2,})', '/', $catalog);

$handle=opendir(START_PATH.'/'.$catalog);
rewinddir($handle);
while ($file = readdir($handle))
 {
  $filenames[]=$file;
 }
closedir($handle);

 $str = 'Current directory: <b>&laquo;'.START_PATH.$catalog.'&raquo;</b>';
 print $str;

 echo '<br><br><table class=tabler>';
 echo '<tr class=menu_tr>';
 echo '<td><h4>Record type <td><h4>Path</tr>';

 for ($i = 0; $i < count($filenames); $i++)
  {
   if ($filenames[$i]!='.' && $filenames[$i]!='..')
    {
     if (is_dir(START_PATH.$catalog.'/'.$filenames[$i]))
      {
       print '<tr class=ordinary_tr><td>Directory</td><td>';
       print '<a
href=qw.php?catalog='.$catalog."/".$filenames[$i].'>'.$filenames[$i].'</a></
td>';
      }
      else
       {
        print '<tr class=ordinary_tr><td>File</td><td>';
        print '<a
href=qw.php?pather='.START_PATH.$catalog."/".$filenames[$i].'>'.$filenames[$
i].'</a></td>';
       }
      print '</tr>';
    }
  }


?>
 </table>





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to