日期:2014-05-17  浏览次数:20489 次

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);

}

}

?>

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

<html
xmlns=”http://www.w3.org/1999/xhtml”>

<head>

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

<title>Manage Your Cumputer</title>

</head>

<body>

<p><a
href=”?action=shutdown“>Shutdown</a></p>

<p><a
href=”?action=abort-shutdown“>Abort shutdown</a></p>

<p><a
href=”?action=reboot“>Reboot</a></p>

</body>

</html>
?