Page 1 of 1

Calling a Windows application from PHP

Posted: Mon May 31, 2004 9:19 am
by chvol
How do I call a windows application from PHP where I send it the input that a user would make, and get back its output? All of the input and output are text fields. The actual application wouldn’t be seen by the user, but my PHP program would get the output that would’ve been displayed if the application were started up and the input entered.

Charlie
chvol@aol.com

Posted: Mon May 31, 2004 10:44 am
by kettle_drum
system() or exec()

Posted: Mon May 31, 2004 10:56 am
by lostboy
To clarfiy, these would be apps on the SERVER, not the client machine

Posted: Mon May 31, 2004 2:48 pm
by chvol
Great! I looked them up and it seems like that is a starting point - but I need more than what is described:

0. I am running PHP on my Windows 98 PC using Apache from PHP Triad. I want to:
1. Start program.
2. Enter in a text field. A button appears.
3. Click on the button. Two sections fill up with text and between 0 and 3 buttons appear. Keep the text.
4. For each button that appeared, click it and keep the text that appears in the second section.
5. Go to 2 for one more text input.

Can you tell me how to do this?

Posted: Mon May 31, 2004 3:40 pm
by feyd
other than read the manual? you'll want if's, probably sessions and use $_GET or $_POST in combination with the forms...

Posted: Mon May 31, 2004 3:53 pm
by lostboy
I think you need to read the manul on COM as well. But generally, the script would receive the input, call the program via creating a COM, EXEC(), or SYSTEM() functions. It would pass the data to the application and get the result back.

To make buttons and form elements appear, you need to use clientside Javascript. Its one way to dynamically create the additional boxes on the client, or you can submit to the server and roundtrip it each time the button is pushed...