EXEC()?

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
max_carpenter
-


Joined: 18 Mar 2005
Posts: 124

PostPosted: Tue Jul 25, 2006 11:17 pm    Post subject: EXEC()? Reply with quote

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 View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Wed Jul 26, 2006 5:03 am    Post subject: Reply with quote

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 View user's profile Send private message
max_carpenter
-


Joined: 18 Mar 2005
Posts: 124

PostPosted: Wed Aug 02, 2006 4:39 pm    Post subject: Reply with quote

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 View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group