Jump to content

How to run a console app and use its output in website


hasanatkazmi

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.