php页面传参给shell脚本

匿名 (未验证) 提交于 2019-12-02 22:11:45

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>MAC search</title>

</head>

<body align="middle" bgcolor="gray">

<h1><font size="20" face="Verdana" color="blue">MAC search</font></h1>

<form action="" method="post">

MAC:

<input type="text" name="mac" size="20"/>

<input type="submit" value="submit"/>

</form>

<?php

if(isset($_POST['mac'])&&$_POST['mac']!=''){

$output = shell_exec("macsearch $mac");

echo "$output";

}

?>

</body>

</html>

分析如下:

补充:今天遇到一个问题,通过php页面执行这个脚本的时候无效,macsearch脚本中的wget命令未执行(macsearch脚本在博文《字符串按位数分隔》中有)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!