FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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
Related topics
Cannot Get Directory Listing
why do I get a directory listing when I go to my site?
Directory lister
Directory listing
(Request a directory listing) Ne demek?
What is Directory Listing ?
directory listing
I cant get the directory listing
What is the directory listing?
directory listing
Point Reduction And Directory Listing
Does Frihost directory listing worth 50$
change directory listing domain?
directory listing
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

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