hasanatkazmi Posted March 24, 2008 Share Posted March 24, 2008 Hi, I want to make an web application where if an event occurs (say user clicks execute me) than a program triggers on my computer, does some thing and then returns the data back to the site so that i can show the result to the visitor lets make it more understandable see this diagram http://www.pixel-touch.com/untitled.bmp I badly need help Link to comment https://forums.phpfreaks.com/topic/97697-how-to-run-a-console-app-and-use-its-output-in-website/ Share on other sites More sharing options...
A2xA Posted March 24, 2008 Share Posted March 24, 2008 Could you give me an example of why they are clicking it/what you are trying to do through this? Also, are you hosted through your windows server. If so, I think this might be possible. I'm pretty sure someone isn't going to write the whole code for you though. Link to comment https://forums.phpfreaks.com/topic/97697-how-to-run-a-console-app-and-use-its-output-in-website/#findComment-499907 Share on other sites More sharing options...
uniflare Posted March 24, 2008 Share Posted March 24, 2008 basically the only way i know of is something like: a php script runs an executable with optional arguments like windows; the executable then does its stuff and opens a browser window in ie with _GET variables in the url with the information. (unless you know how to send _POST vars directly, or communicate directly with a webserver just like a browser); then a different php script would use the variables provided and continue; -------- so you would need a transmit.php file and a recieve.php file or you could combine with certain if statements or switches to make a single communication.php file. --------- You can run Windows Executable Files by using the shell_exec() function php.net/shell_exec you could also run unix scripts etc as well as this communicates via the shell (or DOS). NOT SURE if works on winxp as (i think) DOS was removed as a system Shell type program from winxp. hope this helps, Link to comment https://forums.phpfreaks.com/topic/97697-how-to-run-a-console-app-and-use-its-output-in-website/#findComment-499912 Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 the return of an exec can be assigned to a variable in php or you can make your .exe or other application return the results to a predictable text file that after the exec happens php can then hunt down and extract data out of. Link to comment https://forums.phpfreaks.com/topic/97697-how-to-run-a-console-app-and-use-its-output-in-website/#findComment-499916 Share on other sites More sharing options...
hasanatkazmi Posted March 24, 2008 Author Share Posted March 24, 2008 well, thanks for the replies, but there is a problem. The PHP files are hosted on the web server, If I, by browsing in windows explorer do to the batch file and execute that, it will work, but if it is executed over http, the IIS and Apache wont allow due to Secuty reasons. (correct me if i am wrong) What should I do in this case, please suggest me some key words which I can google to get some lid Link to comment https://forums.phpfreaks.com/topic/97697-how-to-run-a-console-app-and-use-its-output-in-website/#findComment-499947 Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 look up exec if its your sever you should be able to config it so that it can run internal applications via internal file pointers. Link to comment https://forums.phpfreaks.com/topic/97697-how-to-run-a-console-app-and-use-its-output-in-website/#findComment-499957 Share on other sites More sharing options...
hasanatkazmi Posted March 24, 2008 Author Share Posted March 24, 2008 look up exec if its your sever you should be able to config it so that it can run internal applications via internal file pointers. Thanks You very much, I think i am on the right path. Link to comment https://forums.phpfreaks.com/topic/97697-how-to-run-a-console-app-and-use-its-output-in-website/#findComment-499976 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.