php 执行shell
请输入代码
<?php
$url=$_POST["url"];
if(empty($url)) die(0);
$shell = "wget -P /down/ " .$url;
echo "<pre>";
exec($shell, $result, $status);
echo "</pre>";
//注意shell命令的执行结果和执行返回的状态值的对应关系
$shell = "<font color='red'>$shell</font>";
if( $status ){
echo "failur";
} else {
echo "success";
}
?>
评论已关闭