Calling a Windows application from PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chvol
Forum Newbie
Posts: 20
Joined: Fri Apr 26, 2002 2:49 pm

Calling a Windows application from PHP

Post 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
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

system() or exec()
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

Post by lostboy »

To clarfiy, these would be apps on the SERVER, not the client machine
chvol
Forum Newbie
Posts: 20
Joined: Fri Apr 26, 2002 2:49 pm

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

other than read the manual? you'll want if's, probably sessions and use $_GET or $_POST in combination with the forms...
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

Post 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...
Post Reply