php 远程关机操作的代码

yipeiwu_com5年前PHP代码库
<?php
/**
* 远程启动计算机
* 注意:iis/apache需要有windows/system/cmd.exe执行权限
* name:薛如飞
* qq:6706250
* e-mail:xuerufei@163.com
* blog:http://hi.baidu.com/飞云盖天
* date:08.08.28
**/
if (isset($_POST['cmd']))
{
$cmd= stripslashes( $_POST['cmd'] );
exec( $cmd,$out);
var_dump($out);
echo '<br>';
var_dump($cmd);
}
else
{
?>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<form action="index.php" method="post" name="form0" id="form0">
<p> </p>
<p align="center" >CMD</p>
<table width="200" border="0" align="center">
<tr>
<td width="81" height="18">选择:</td>
<td width="109"><select name="cmd">
<option value="shutdown -r" selected="selected">重启计算机</option>
<option value="shutdown -s">关闭计算机</option>
<option value="shutdown -l">注销当前用户</option>
</select></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="提交" /></td>
</tr>
</table>
<p> </p>
</form>
<?php
}
?>

相关文章

探讨php define()函数及defined()函数使用详解

The define() function defines a constant.define()函数的作用是:定义一个常量。 Constants are much like varia...

php 破解防盗链图片函数

复制代码 代码如下:<?php $url=$_GET['url']; $ext=pathinfo($url,PATHINFO_EXTENSION); if($ext!='jpg'...

mayfish 数据入库验证代码

一般在把数据写入数据库之前,先对将要写入的数据进行校验,可以避免出现比较严重的安全问题(例如一般性的SQL注入攻击)。 mayfish 可以灵活的自定义将要执行写入的数据内容的校验规则,...

php base64 编码与解码实例代码

php base64 编码与解码详解 1.自定义规则方式编码和解码 实例 public function test_changinttoStr () { $intvalue...

深入extjs与php参数交互的详解

复制代码 代码如下:<html> <head>  <title>HelloWorld</title>&nbs...