can php interact with a c program?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • skeeterbug

    can php interact with a c program?

    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

    #2
    Re: can php interact with a c program?

    In article <1109052413.087 955.244580@z14g 2000cwz.googleg roups.com>,
    "skeeterbug " <jskeith1@san.r r.com> wrote:
    [color=blue]
    > 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...[/color]




    This assumes the C program does everything through standard input and
    output. Then you can just call it from the system() or passthru()
    functions.

    --
    DeeDee, don't press that button! DeeDee! NO! Dee...



    Comment

    • noSpam

      #3
      Re: can php interact with a c program?

      Michael Vilain wrote:[color=blue]
      > In article <1109052413.087 955.244580@z14g 2000cwz.googleg roups.com>,
      > "skeeterbug " <jskeith1@san.r r.com> wrote:
      >
      >[color=green]
      >>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...[/color]
      >
      >
      > 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.
      >[/color]
      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"

      Comment

      • Jean-Marc Molina

        #4
        Re: can php interact with a c program?

        skeeterbug a écrit/wrote :[color=blue]
        > 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...[/color]

        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.

        Comment

        Working...