biketrialler Posted November 26, 2005 Report Share Posted November 26, 2005 heya, just looking for a simple script... on my webspace, i want it to list the files when i go to www.bennifer.co.uk rather than just say access denied like it does right now. what is a simple php file i can put in the root of that folder that will then just list out what is in it? i did google, but didnt find what i was after - its hard to know what to search for. thanks to helpers! ben Quote Link to comment Share on other sites More sharing options...
Dai the Socket Posted November 26, 2005 Report Share Posted November 26, 2005 I think I've sorted you good (Y) Quote Link to comment Share on other sites More sharing options...
Simon Posted November 27, 2005 Report Share Posted November 27, 2005 You wan't directory listing. Search in google for "directory listing php", maybe add in "script", and theres tonnes. Else, i found this one; http://evoluted.net/archives/2005/08/directory_listi_2.php and it seems to do the job just great. :lol: Quote Link to comment Share on other sites More sharing options...
Danny Posted November 27, 2005 Report Share Posted November 27, 2005 The one i use is the following <? ////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Image View / Upload Section /////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////// echo "<h1>".$title." - News/Product Images</h1>"; echo "<div id=\"bigbox\">"; $list_ignore = array ('.','..','listing.php'); $handle=opendir("."); $dirs=array(); $files=array(); $i = 0; while (false !== ($file = readdir($handle))) { if (!in_array($file,$list_ignore)) { if(!eregi("([.]bak)",$file)) { // ignore backup files if(is_dir($file)) { $dirs[]=$file; } else { $files[]=$file; } $i++; } } } closedir($handle); $tab=array_merge($dirs,$files); if ($i) { foreach ($tab as $rep) { if(eregi("[.]doc", $rep)) { $ext="txt"; } elseif(eregi("([.]zip)|([.]rar)", $rep)) { $ext="zip"; } elseif(eregi("([.]gif)|([.]jpg)|([.]jpeg)|([.]png)", $rep)) { $ext="image"; } elseif(eregi("([.]html)|([.]htm)", $rep)) { $ext="html"; } elseif(eregi("[.]php", $rep)) { $ext="php"; } elseif($rep[folder]==true) { $ext="folder"; } else { $ext="unknown"; } echo ('<a href="'.$rep.'"><img src="images/'.$ext.'.gif" border="0" /> '.$rep.'</a><br />'); } } else { echo "No files"; } echo "</div>"; ?>[/code] Quote Link to comment Share on other sites More sharing options...
Dai the Socket Posted November 27, 2005 Report Share Posted November 27, 2005 Haha that's well stole from the 2plus1 Clothing code damn you. echo "<div id=\"bigbox\">"; Quote Link to comment Share on other sites More sharing options...
biketrialler Posted November 27, 2005 Author Report Share Posted November 27, 2005 cheers danny for sorting it out! and nick for help too! Quote Link to comment Share on other sites More sharing options...
Danny Posted November 27, 2005 Report Share Posted November 27, 2005 Haha that's well stole from the 2plus1 Clothing code damn you. echo "<div id=\"bigbox\">"; Its stolen from dannytipple.co.uk actually. Quote Link to comment Share on other sites More sharing options...
Dai the Socket Posted November 28, 2005 Report Share Posted November 28, 2005 (edited) Its stolen from dannytipple.co.uk actually. Yeah, Um, Er, Whatever :D :lol: :) Edited November 28, 2005 by mod661 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.