this is the source code of the shell im remaking
but i just want a piece of php script that will show all files with a certain extention in a certaian place
so like all .log files get shown in the logs file list
any help?
the source can be found at shelltest.freehostia.com/1.zip
i hate these code restrictions
i need some help witha php code
Enjoy
Code: Select all
<?PHP
/*
## Directory script by Gogeta70 ##
## You may change and spread ##
## this code freely, just keep ##
## this notice here. ##
*/
$dir = opendir("."); // Open the current directory.
$ext = $_POST['ext']; // Get the file extention
$file = NULL;
$adir = array();
while(($file = readdir($dir)) !== FALSE)
{
$gext = explode(".", $file);
$count = count($gext) - 1;
if(strtolower($gext[$count]) == $ext)
{
if(is_dir($file))
{
$adir[] = "[Directory] $file";
} else {
$adir[] = $file;
}
}
}
sort($adir, SORT_REGULAR);
for($a = 0; $a < count($adir); $a++)
{
echo $adir[$a] . "<br/>";
}
¯\_(ツ)_/¯ It works on my machine...
http://shelltest.freehostia.com/1/shell1.php
thats wat i get when i try it,did i do sumfin wrong?
thats wat i get when i try it,did i do sumfin wrong?