Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Directory Listing
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Sean" data-source="post: 211470" data-attributes="member: 10142"><p style="text-align: center"><span style="font-family: 'arial'"><span style="font-size: 15px"><span style="color: #387ac7"><strong>DIRECTORY LISTING</strong></span></span></span></p><p></p><p><span style="font-family: 'arial'">Thought I would share a simple PHP directory listing that I use on my localhost to help keep things organised, i</span><span style="font-family: 'arial'">t is styled to match google chromes default look. </span><span style="font-family: 'arial'">Simply put this code into a file called index.php and drop into your htdocs or locahost root.</span></p><p> </p><p><span style="font-family: 'arial'">I know there are lots of Directory Listings around but, Oh well. I wanted to keep it simple and small so it doesn't take ages to load so there is no search feature, JS or folder sizes. It is also impossible to style the option part of a select form nicely without JS, I could change colours (except blue highlight) but that would be a waste of time.</span></p><p> </p><p> </p><p><strong><span style="color: #ff0000"><span style="font-family: 'arial'">I don't really care what people think so if you want to say something nasty, by all means go ahead, you are only wasting your own time.</span></span></strong></p><p> </p><p>[PHP]<!DOCTYPE HTML></p><p><html></p><p><head></p><p><title> Localhost Projects </title></p><p><style type="text/css"></p><p>body {</p><p>background: #DDDDDD;</p><p>}</p><p> </p><p>#content {</p><p>margin: 20% auto;</p><p>width: 200px;</p><p>}</p><p> </p><p>select {</p><p>-webkit-appearance: button;</p><p>-webkit-border-radius: 2px;</p><p>webkit-box-shadow: 0 8px 6px -6px #BBBBBB;</p><p> -moz-box-shadow: 0 8px 6px -6px #BBBBBB;</p><p> box-shadow: 0 8px 6px -6px #BBBBBB;</p><p>-webkit-padding-end: 5px;</p><p>-webkit-padding-start: 5px;</p><p>-webkit-user-select: none;</p><p>cursor: pointer;</p><p>background-image: -webkit-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5);</p><p>border: 1px solid #AAAAAA;</p><p>color: #555555;</p><p>font-size: 14px;</p><p>font-weight: bold;</p><p>margin: 0;</p><p>overflow: hidden;</p><p>padding-top: 2px;</p><p>padding-bottom: 2px;</p><p>text-overflow: ellipsis;</p><p>white-space: nowrap;</p><p>height: 40px;</p><p>}</p><p> </p><p>select:focus {</p><p>outline: none;</p><p>}</p><p></style></p><p></head></p><p><body></p><p><div id="content"></p><p><select onchange="if (this.value) window.location.href=this.value"></p><p><option selected disabled>Localhost Projects</option></p><p><?php</p><p>foreach(glob('*', GLOB_ONLYDIR) as $dir) {</p><p>echo '<option value='.$dir.'>'.$dir.'</option>';</p><p>}</p><p>?></p><p></select></p><p></div></p><p></body></p><p></html>[/PHP]</p><p> </p><p>Preview:</p><p style="text-align: center"><img src="http://i.sharefa.st/O57nB9hHQEw0.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"><img src="http://i.sharefa.st/2Y10KZmLQEw0.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p style="text-align: center"><img src="http://i.sharefa.st/IsWWmL6RQEw0.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p></blockquote><p></p>
[QUOTE="Sean, post: 211470, member: 10142"] [CENTER][FONT=arial][SIZE=4][COLOR=#387ac7][B]DIRECTORY LISTING[/B][/COLOR][/SIZE][/FONT][/CENTER] [FONT=arial]Thought I would share a simple PHP directory listing that I use on my localhost to help keep things organised, i[/FONT][FONT=arial]t is styled to match google chromes default look. [/FONT][FONT=arial]Simply put this code into a file called index.php and drop into your htdocs or locahost root.[/FONT] [FONT=arial]I know there are lots of Directory Listings around but, Oh well. I wanted to keep it simple and small so it doesn't take ages to load so there is no search feature, JS or folder sizes. It is also impossible to style the option part of a select form nicely without JS, I could change colours (except blue highlight) but that would be a waste of time.[/FONT] [B][COLOR=#ff0000][FONT=arial]I don't really care what people think so if you want to say something nasty, by all means go ahead, you are only wasting your own time.[/FONT][/COLOR][/B] [PHP]<!DOCTYPE HTML> <html> <head> <title> Localhost Projects </title> <style type="text/css"> body { background: #DDDDDD; } #content { margin: 20% auto; width: 200px; } select { -webkit-appearance: button; -webkit-border-radius: 2px; webkit-box-shadow: 0 8px 6px -6px #BBBBBB; -moz-box-shadow: 0 8px 6px -6px #BBBBBB; box-shadow: 0 8px 6px -6px #BBBBBB; -webkit-padding-end: 5px; -webkit-padding-start: 5px; -webkit-user-select: none; cursor: pointer; background-image: -webkit-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5); border: 1px solid #AAAAAA; color: #555555; font-size: 14px; font-weight: bold; margin: 0; overflow: hidden; padding-top: 2px; padding-bottom: 2px; text-overflow: ellipsis; white-space: nowrap; height: 40px; } select:focus { outline: none; } </style> </head> <body> <div id="content"> <select onchange="if (this.value) window.location.href=this.value"> <option selected disabled>Localhost Projects</option> <?php foreach(glob('*', GLOB_ONLYDIR) as $dir) { echo '<option value='.$dir.'>'.$dir.'</option>'; } ?> </select> </div> </body> </html>[/PHP] Preview: [CENTER][IMG]http://i.sharefa.st/O57nB9hHQEw0.png[/IMG][/CENTER] [CENTER][IMG]http://i.sharefa.st/2Y10KZmLQEw0.png[/IMG][/CENTER] [CENTER][IMG]http://i.sharefa.st/IsWWmL6RQEw0.png[/IMG][/CENTER] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Directory Listing
Top