Latest Movies :
Home » » How to list files in a directory with PHP

How to list files in a directory with PHP


Here’s a simple way to execute the windows dir or the linux ls in PHP Windows: <?php $row = exec('dir',$output,$error); while(list(,$row) = each($output)){ echo $row, "<BR>\n"; } if($error){ echo "Error : $error<BR>\n"; exit; } ?> Linux: <?php $row = exec('ls -ls',$output,$error); while(list(,$row) = each($output)){ echo $row, "<BR>\n"; } if($error){ echo "Error : $error<BR>\n"; exit; } […]
Here’s a simple way to execute the windows dir or the linux ls in PHP
Windows:
<?php
$row = exec('dir',$output,$error);
while(list(,$row) = each($output)){
echo $row, "<BR>\n";
}
if($error){
echo "Error : $error<BR>\n";
exit;
}
?>
Linux:
<?php
$row = exec('ls -ls',$output,$error);
while(list(,$row) = each($output)){
echo $row, "<BR>\n";
}
if($error){
echo "Error : $error<BR>\n";
exit;
}
?>
Share this article :

+ comments + 1 comment

September 24, 2020 at 7:19 AM

This professional hacker is absolutely reliable and I strongly recommend him for any type of hack you require. I know this because I have hired him severally for various hacks and he has never disappointed me nor any of my friends who have hired him too, he can help you with any of the following hacks:

-Phone hacks (remotely)
-Credit repair
-Bitcoin recovery (any cryptocurrency)
-Make money from home (USA only)
-Social media hacks
-Website hacks
-Erase criminal records (USA & Canada only)
-Grade change
-funds recovery

Email: onlineghosthacker247@ gmail .com

Post a Comment

 
Support : Creating Website | Sital Template | Black Template
Copyright © 2011. Hacking - All Rights Reserved
Template Modify by Creating Website
Proudly powered by Sital Mandal