This is a discussion on can php interact with a c program? within the PHP Language forums, part of the PHP Programming Forums category; i do some web db stuff using php. i coworker asked me if he could develop a php front end ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
i do some web db stuff using php. i coworker asked me if he could
develop a php front end that would ultimately end up interacting with a program he had written in c (c++ or whatever). can php do this sort of thing or is it a dead end? tia... |
|
|||
|
Michael Vilain wrote:
> In article <1109052413.087955.244580@z14g2000cwz.googlegroups .com>, > "skeeterbug" <jskeith1@san.rr.com> wrote: > > >>i do some web db stuff using php. i coworker asked me if he could >>develop a php front end that would ultimately end up interacting with a >>program he had written in c (c++ or whatever). >> >>can php do this sort of thing or is it a dead end? tia... > > > http://us4.php.net/manual/en/function.system.php > http://us4.php.net/manual/en/function.passthru.php > > This assumes the C program does everything through standard input and > output. Then you can just call it from the system() or passthru() > functions. > Or shared memory or flat files or a table in a database or the Zend API, lots of ways, depends upon what you mean by "interact" |
|
|||
|
skeeterbug a écrit/wrote :
> i do some web db stuff using php. i coworker asked me if he could > develop a php front end that would ultimately end up interacting with > a program he had written in c (c++ or whatever). > > can php do this sort of thing or is it a dead end? tia... Sure, see your application as a client-server one. There are different ways to implement such an application and the best one is probably to make your PHP application a web service. Using XML protocols like SOAP so you should be able to send messages from one application to an other, exchange data, anything. It all depends of what you want to do. What did you mean by interaction ? Real-time respond ? Data exchange ? Data fetch at a specific time of the day ? -- Jean-Marc. |