Files
lpmj6/named_examples/exec.php
T
RobinNixon 0335342e00 First Draft
First Draft of the Example Files
2020-12-10 13:21:38 +00:00

15 lines
298 B
PHP

<?php // exec.php
$cmd = "dir"; // Windows
// $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>";
}
?>