Top

PHP Directory List

Please Register to submit score.
Average Score  0.0
Scores Submitted  0
Date Added  Apr 24, 2008
Last Updated  Apr 24, 2008
Tags  .php  css  directory  file  files  handle  jonesy  jonesy44  list  php  style  while 

Introduction

Ok, so this short php script is real usefull for if you have loads of subdirectories of completely different websites like i do. these can be webs for sale, or just random websites *shrugs* it's for your use :-)

Check the example pic for more details (upload after i post this)
But the basics are, change the $dir variable to the directory you want to search including "/home/www/" if you are on a general apache server (You can find this by simple editing a file in the generic Browser Control Panel, it will say what file you are editing, therefore giving the directory. Once you point the script towards the main directory, it will search any subdirectories, if it finds an "index.php" file within a subdirectory, it will give a link to it, and more info, else it will message an error message.
(Check back to example pic)

Where it says "$dir = THE_DIRECTORY_GOES_HERE;", it will be something like "/home/www/wfs.myartsonline.com/" which is what i use in the picture example.

Drop a comment if you need some help or have any queries :-) or simply a comment.

For a general example of this: http://wfs.myartsonline.com

----------------------------

Add this stylsheet if you want it (COMPLETELY OPTIONAL!)
Code:
<style>
body {
 font-family: times;
}
h1 {
 font-family: times;
}
a {
 color: #000000;
 background: #ffffff;
}
a:hover {
 color: #ffffff;
 background: #000000;
}
</style>


--------------------------------

Example:


Grab the Code

Comments

  (5)  RSS
jonesy44
Comments: 665
 
PHP Snippet:  PHP Directory List
Posted on Apr 24, 2008 5:34 pm
*Update, added the example image :P
F*U*R*B*Y*
Comments: 414
 
PHP Snippet:  PHP Directory List
Posted on May 5, 2008 1:54 am
This will not work on a Windows Operating System, as PHP on Windows does not contain the fnmatch function....
jonesy44
Comments: 665
 
PHP Snippet:  PHP Directory List
Posted on May 5, 2008 7:45 am
:-s

Any ideas on what i can use instead of fnmatch ?
markusPHP
Comments: 9
 
PHP Snippet:  PHP Directory List
Posted on Jun 16, 2008 11:47 am
http://uk.php.net/fnmatch
Scroll down for some talk on fnmatch() substitutes
jonesy44
Comments: 665
 
PHP Snippet:  PHP Directory List
Posted on Jun 16, 2008 11:53 am
I've used preg_match since.
But since the server i run on is CentOS, i'm all good :p

Please Register or Login to start posting comments.
Bottom