[web] PHP?

Started by
2 comments, last by kanzler 19 years, 2 months ago
Is there any way to use PHP to execute or send information to a (compiled) program that is on a server? I other words, let's say I have a program running on my server. How can I use PHP or HTML forms to send information to that program so it can further process information, and then send information back to a web interface? Any ideas at least? I just need to communicate with an executable program that is running on a webserver through a web interface. PHP? What? How can I do this? Thanks for any tips.
Advertisement
The PHP parser itself works by taking the input from the stdin stream, processing it and finally outputting the result to stdout stream. You could follow the same practice with your executable, and use the PHP command "exec" to drive it based on the web request.

Niko Suni

You can also toy around with the apache handlers. It's possible to set apache up in such a way that certain executable files get executed on the server instead of being downloaded when you request then with a browser.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

Sine PHP 4.3 there is a great function which provides bi-directional stdin, stdout and stderr streams to a program: proc_open(). You could also use system() if you don't need the power of proc_open().

This topic is closed to new replies.

Advertisement