Home  >  Article  >  Backend Development  >  php实现用手机关闭计算机的方法_PHP教程

php实现用手机关闭计算机的方法_PHP教程

WBOY
WBOYOriginal
2016-07-13 09:56:21963browse

php实现用手机关闭计算机的方法

   php实现用手机关闭计算机(电脑)的方法

        本文实例讲述了php实现用手机关闭计算机(电脑)的方法。分享给大家供大家参考。具体分析如下:

  适合有手机和电脑,用wifi的php web开发。方便关闭你的电脑(尤其在你想睡觉时 ),适合局域网

  用法:放在你的web项目文件夹,可以新建立个目录

  对了,把你的apache的httpd 或 iis 加入防火墙例外 ,文件是php后缀哦

  ?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

computer-manager

if($_POST){

$shutdown = array(

'shutdown' =>'shutdown -s -t 0',

'restart' => 'shutdown -r',

'logout' => 'shutdown -l',

);

$cmdk = $_POST['cmd'];

echo $cmd = $shutdown[$cmdk];

system($cmd); // 执行操作

}

?>

choose you want.

shutdown/ go to sleep.

restart computer/ ok, if no password.

logout/ you don't want this.

  希望本文所述对大家的php程序设计有所帮助。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/988366.htmlTechArticlephp实现用手机关闭计算机的方法 php实现用手机关闭计算机(电脑)的方法 本文实例讲述了php实现用手机关闭计算机(电脑)的方法。分享给大...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn