 |
 |
Screenshots taken from ingame.
//ok klay lets firat start a counter
$count = 0;
$tablecount = 0;
// now select the directory name
$dir = "BF2";
// now we open the folder
if(is_dir($dir)) // if what you put above is a directory
{
if($dh = opendir($dir))
// iterate over the file list
{
// print the filenames
while(($filename = readdir($dh)) !== false) // if it aint empty
{
if(($filename != ".") && ($filename != "..")) // here i tell it to ignore dir links ;-)
{
$count++;
$tablecount ++;
if($tablecount == "0"){
$tablecount = 0;
echo "";
}
// here i stip off the extension from the file ;-)
$displayname = explode(".",$filename);
// here i chuck the HTML for displaying it.
echo " ".$filename."";
}}
// close the directory
closedir($dh);
}
}
// if you want to cound how many files are there... display the counter like so:
echo "
$count files found";
?>
|
|