faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

9 of 30 people (30%) answered Yes
Recently 2 of 10 people (20%) answered Yes


How can windows (XP Pro) be shut down/ restarted via PHP?

Feb 27th, 2008 00:05
dman, taylor gerring, Matt Barley, http://www.ttnr.org

you can use php to execute a system call several. This first and more 
common is through the use of the system() function. It exectures the 
string argument and returns the output. for example, to show the 
output of an dir on a windows machine (or an ls on a unix box), you 
might try something such as this:
echo system("dir");
additionally, php can execute system calls through the use of 
backticks (echo `dir`;) and a number of other methods which can be 
found at http://www.php.net/manual/en/ref.exec.php
you will have to find out the command to execute on a windows system 
that issues the shutdown process a simple google search should turn up 
the right results