FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

PHP: Directory listing code

 


kv
Here is the code which helps you go through the files of your directory
Code:

$dir = "<your dir here>";   
 
if (is_dir($dir))
{   
   if ($dirhandler = opendir($dir))
   {   
       while (($file = readdir($dirhandler)) !== false)
       {   
           if($file !== '.' AND $file !== '..')
           {   
   echo $file;
   //replace above line with your code
           }   
       }   
       closedir($dirhandler);   
   }   
}
Guest
@kv
Here is the code which helps you go through the files of your directory
Code:

$dir = "<your dir here>";   
 
if (is_dir($dir))
{   
   if ($dirhandler = opendir($dir))
   {   
       while (($file = readdir($dirhandler)) !== false)
       {   
           if($file !== '.' AND $file !== '..')
           {   
   echo $file;
   //replace above line with your code
           }   
       }   
       closedir($dirhandler);   
   }   
}

===============

Nice .... hehehe... although you take it from php manual Very Happy
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.