PDA

View Full Version : Gaming Resorce



Jack!
22-08-2009, 02:00 PM
Hey guys,

I need your help, basicly i am starting a gaming resorce site, i already have thousands of files, but that is my problem, to go through and add them all would take me forever, so is there a way via html or php to:

put in the path to the folder, then on the page all of the folders and files are shown for the user to browse, so all i have to add is the path, then the script will find and display the files

Fehm
22-08-2009, 02:03 PM
http://www.clanthemes.com/tutorials-view-140-display-all-files-in-a-directory.html

Quick google search might not work

Jack!
22-08-2009, 02:04 PM
I did, but i wasnt 100% sure on what to put so i couldnt find anything to do with what i needed

Thanks

Fehm
22-08-2009, 02:06 PM
Okay, lol. Sorry I couldnt help more, Im in a bit of a rush lol

Jack!
22-08-2009, 02:13 PM
OK, ive fixed it, but with this new script

(downloadzi.co.cc)

i want the files to show up as hyperlinks, anyway to do this?

code:


<?
function showDir($dir, $depth=0)
{
if(!is_dir($dir)){
die("not a directory");
}

$od = opendir($dir);

while(($file = readdir($od)) !== false){

if($file != "." && $file != "..")
{
if(is_dir("$dir/$file"))
{
echo "<tr><td>";
echo str_repeat(" ", $depth) . " [$file]";
echo "</td></tr>";
showDir("$dir/$file", ($depth + 1));
}
else
{
echo "<tr><td>";
echo str_repeat(" ",$depth) . " $file ";
echo "</td><td>";
echo ceil(filesize("$dir/$file")/1000)." KB";
echo "</td></tr>";
}
}

}

}
?>
<table>
<tr>
<th>Directory/File Name</th>
<th>Size</th>
</tr>
<?
showDir("/home/downloa1/public_html/game/");
?>
</table>

Jack!
22-08-2009, 02:35 PM
Please help?

Edit time over for above post

VirtualG
23-08-2009, 05:45 AM
Hey guys,

I need your help, basicly i am starting a gaming resorce site, i already have thousands of files, but that is my problem, to go through and add them all would take me forever, so is there a way via html or php to:

put in the path to the folder, then on the page all of the folders and files are shown for the user to browse, so all i have to add is the path, then the script will find and display the files
Ok, let me fix that for you:


I need your help, basically I am starting a gaming resource site, I already have thousands of files, but that is my problem, to go through and add them all would take me forever, so is there a way via html or php to:

Put in the path to the folder, then on the page all of the folders and files are shown for the user to browse, so all I have to add is the path, then the script will find and display the files.


Can you pick the difference (in spelling mistakes)

Want to hide these adverts? Register an account for free!