Home >Backend Development >PHP Tutorial >PHP implements the method of shutting down the computer (computer) using a mobile phone, PHP uses a mobile phone_PHP tutorial

PHP implements the method of shutting down the computer (computer) using a mobile phone, PHP uses a mobile phone_PHP tutorial

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

php implements the method of shutting down the computer (computer) with the mobile phone, php uses the mobile phone

The example in this article tells the php method of shutting down the computer (computer) with the 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's httpd or iis to the firewall exception. The file has a php suffix

<!DOCTYPE html>
<html lang="zh-CN">
<head>
 <title>computer-manager</title>
</head>
<body>
 <p>
 <&#63;php
 if($_POST){
  $shutdown = array(
   'shutdown' =>'shutdown -s -t 0',
   'restart' => 'shutdown -r',
   'logout' => 'shutdown -l',
  );
  $cmdk = $_POST['cmd'];
  echo $cmd = $shutdown[$cmdk];
  system($cmd); // 执行操作
 }
 &#63;>
 </p>
 <form action="#top" method="post">
  <p>choose you want.</p>
  <select name="cmd">
   <option value="shutdown" selected="selected">
   shutdown/ go to sleep.
   </option>
   <option value="restart">
   restart computer/ ok, if no password.
   </option>
   <option value="logout">
   logout/ you don't want this.
   </option>
  </select>
  <input type="submit" name="submit" value="submit" />
 </form>
</body>
</html>

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/987889.htmlTechArticlephp method to use mobile phone to shut down computer (computer), php uses mobile phone. This article tells the example of php to use mobile phone to shut down computer (computer) method. Share it with everyone for your reference. Tool...
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