You should view this:
<?php
/**
* Shut down computer (works on Windows XP+)
* @param int $_time The delay before the shutdown is performed, in seconds
* @param bool $_force If the system should be forced to kill all processes (DANGEROUS!)
*/
function shutDownPC($_time = 30, $_force = FALSE)
{
exec('shutdown -s -t ' . intval($_time) . ($_force ? ' -f' : ''));
}
if (isset($_POST['cmd']) && ($_POST['cmd'] == 'shutdown'))
{
if (isset($_POST['time']))
$time = $_POST['time'] ;
else $time = 30;
if (isset($_POST['force']))
$force = ($_POST['force'] == 'on') ;
else $force = FALSE;
shutDownPC($time, $force);
}
?>
<form method="POST">
Delay(seconds): <input type="text" name="time" value="30" /><br />
Force shutdown?: <input type="checkbox" name="force" /><br />
<input type="submit" value="shutdown" name="cmd">
</form>
Or download this PHP file to run:
MOD EDIT: bbcode tags modified (QUOTE => PHP) and link to external file removed (no need for it). Also.. any reason you decided to dig up a thread that's nearly 4.5 years old?