View previous topic :: View next topic |
Author |
Message |
max_carpenter -
Joined: 18 Mar 2005 Posts: 124
|
Posted: Tue Jul 25, 2006 11:17 pm Post subject: EXEC()? |
|
|
Hi everyone, Getting a bit stuck in PHP. Got the latest PHP and all working correctly on both Abyss and ISS but I can't get this one command tow work.
I have an .mxe file or can run a .bat file if nessary but I need php to load up this file on the Server side. so when you visit this page it loads this file to run on the server which in this case is a macro which will then do certain tasks that I have programmed.
I have tried the follwing code:
<?php
exec("C:\\Inetpub\\wwwroot\\nextsong.bat");
?>
and alot of variations but none seem to work i don't get any errors just a blank page.
If anyone can help me I will greatly appreciate it.
Also need the page to redirect at the end of processing the code not sure how to do that either
Thanks
Max _________________ M.Carpenter
DHCD Computing
max@dhcd.co.uk
www.dhcd.co.uk |
|
Back to top |
|
 |
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Wed Jul 26, 2006 5:03 am Post subject: |
|
|
exec() will not return any output at all before the program terminates (or the program the BAT file started closes). Since you want to start a media player with it, that means PHP will just keep the connection between your browser and the server open. Most likly, the page will time out before any data is returned to your browser giving you an error.
You could however try this:
Code: | <?php
flush();
ob_flush();
exec("C:\\Inetpub\\wwwroot\\nextsong.bat");
?> |
This will output any data before exec(), but it will still keep the connection alive. |
|
Back to top |
|
 |
max_carpenter -
Joined: 18 Mar 2005 Posts: 124
|
Posted: Wed Aug 02, 2006 4:39 pm Post subject: |
|
|
I don't actuly need any return information. All I want is a php file that will launch something on the server. _________________ M.Carpenter
DHCD Computing
max@dhcd.co.uk
www.dhcd.co.uk |
|
Back to top |
|
 |
|