我使用shell_exec
到我的服务器上执行命令,并显示回声结果。选择并显示服务器文件
现在,我要选择和显示显示的文件。我怎样才能做到这一点?从代码
<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>
结果:
text1.txt
text2.txt
text3.txt
text4.txt
检查文档:http://php.net/manual/en/function.fread.php – Hackerman
你想显示文件的内容或文件名列表? –
该文件的内容。该列表已显示。 – Drennos