Files
lpmj6/07/exec.php
T
RobinNixon 188af22a54 Final
2021-04-18 15:31:38 +01:00

15 lines
310 B
PHP

<?php // exec.php
$cmd = "dir"; // Windows, Mac, Linux
// $cmd = "ls"; // Linux, Unix & Mac
exec(escapeshellcmd($cmd), $output, $status);
if ($status) echo "Exec command failed";
else
{
echo "<pre>";
foreach($output as $line) echo htmlspecialchars("$line\n");
echo "</pre>";
}
?>