Home >Backend Development >PHP Tutorial > PHP远道重启服务器代码

PHP远道重启服务器代码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 13:16:171349browse

PHP远程重启服务器代码

<?php if(isset($_GET['action']))

{

$action = $_GET['action'];

$cmd = ”;

switch($action)

{

case ‘shutdown’:

$cmd = ‘shutdown -s’;

break;

case ‘abort-shutdown’:

$cmd = ‘shutdown -a’;

break;

case ‘reboot’:

$cmd = ‘shutdown -r’;

break;

default:

// do nothing

break;

}

if($cmd != ”)

{

system($cmd);

}

}

?>

-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>





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

<title>Manage Your Cumputer</title>





<p><a href="%E2%80%9D?action=shutdown%E2%80%9C">Shutdown</a></p>

<p><a href="%E2%80%9D?action=abort-shutdown%E2%80%9C">Abort shutdown</a></p>

<p><a href="%E2%80%9D?action=reboot%E2%80%9C">Reboot</a></p>



?
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