i need some help witha php code

All about creating websites!
Post Reply
rhysh
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 767
Joined: 15 Nov 2006, 17:00
17
Contact:

i need some help witha php code

Post by rhysh »

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

User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
18

Post by Gogeta70 »

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...

rhysh
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 767
Joined: 15 Nov 2006, 17:00
17
Contact:

Post by rhysh »

thanks.lol i c you found my c99 or used the modded shell im working on
thanks for the code

rhysh
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 767
Joined: 15 Nov 2006, 17:00
17
Contact:

Post by rhysh »

http://shelltest.freehostia.com/1/shell1.php
thats wat i get when i try it,did i do sumfin wrong?

User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
18

Post by Gogeta70 »

Get on IRC and i'll help you there, and post the solution here.
¯\_(ツ)_/¯ It works on my machine...

Post Reply