Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   execute an exe on the server (http://www.programmingforums.org/showthread.php?t=12272)

theguy0000 Dec 27th, 2006 9:27 PM

execute an exe on the server
 
hello, I will be running on a windows server, and I was wondering if there was a command i could use to execute an exe file on the server.

headzoo Dec 27th, 2006 11:40 PM

Hi,
Check out these functions: http://us2.php.net/manual/en/ref.exec.php
Be careful though, since running untrusted code at the command line opens up a whole can of security risks.

theguy0000 Dec 27th, 2006 11:52 PM

Quote:

Originally Posted by headzoo (Post 121806)
Hi,
Check out these functions: http://us2.php.net/manual/en/ref.exec.php
Be careful though, since running untrusted code at the command line opens up a whole can of security risks.

thank you, and yes I am aware of the security risk, but I am only running one file and it is hard-coded so the user cannot run whatever they want...so I'm not too worried :)

thanks!

theguy0000 Dec 27th, 2006 11:54 PM

so, on the exec fund, where exactly does the output come from? the console of the ran program?

theguy0000 Dec 29th, 2006 6:04 PM

sorry, I meant exe fun, not fund...

and why does no one want to answer me?

niteice Dec 29th, 2006 10:58 PM

exec() returns whatever the program prints on stdout. So if your program is:
:

#include <stdio.h>

int main(int argc, char **argv)
{
    fputs("Hello, world!\n", stdout);
}

The return value of exec() is "Hello, world!\n".

theguy0000 Dec 30th, 2006 11:04 AM

thanks

and above, I meant exec func, not fund or fun, i meant FUNC...lol


All times are GMT -5. The time now is 1:20 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC