I'm using shell_exec
to execute a command on my server and show the result with echo.
Now, I want to select and display the files displayed. How can I do this?
<body>
<form method="get" action="<?php echo $_SERVER["PHP_SELF"] ?>">
<input type="submit" class="reset_button"/>
<p><b>Search</b></p>
<?php
<input type='text' name='idtest' value='' />
<input type='submit' value='consultar' />
?>
<?php
$consulta=$_GET[idtest];
$salida = shell_exec('find / -iname *'.$consulta.'*|sort');
echo "<pre>$salida</pre>";
?>
</body>
Result from code:
text1.txt
text2.txt
text3.txt
text4.txt