Home  >  Article  >  Backend Development  >  PHP method to shut down the computer with a mobile phone_PHP tutorial

PHP method to shut down the computer with a mobile phone_PHP tutorial

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

php method to use mobile phone to shut down computer

 php method to use mobile phone to shut down computer (computer)

This example describes how to use PHP to shut down the computer (computer) using a mobile phone. Share it with everyone for your reference. The specific analysis is as follows:

Suitable for php web development with mobile phones and computers using wifi. Convenient to shut down your computer (especially when you want to sleep), suitable for LAN

Usage: Place it in your web project folder, you can create a new directory

By the way, add your apache httpd or iis to the firewall exception. The file has a php suffix

 ?

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.

1

2 3

45 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); //Perform operation<🎜> <🎜>}<🎜> <🎜>?>

choose you want.

I hope this article will be helpful to everyone’s PHP programming design. http://www.bkjia.com/PHPjc/988366.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/988366.htmlTechArticlephp realizes the method of shutting down the computer with the mobile phone php realizes the method of shutting down the computer (computer) with the mobile phone. This article tells the example of php Implement the method of shutting down the computer (computer) with your mobile phone. Share with everyone...
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