|
Posted by Chung Leong on 08/15/06 03:46
David T. Ashley wrote:
> Hi,
>
> On a Linux platform, I have the need to call a compiled 'C' program from a
> PHP script (to do some special authentication), and to keep the information
> passed from the PHP script to the compiled 'C' program secret, i.e. the
> information should not be passed on the command-line.
>
> The PHP pipe manipulation functions (such as popen) were suggested to me.
>
> Where can I find out more about pipes, specifically:
>
> a)How to use the C library calls to manipulate pipes?
Google "stdio.h". To read from stdin, you just do it as though you're
reading from the keyboard, with functions like gets() and getc(). To
write to stdout, you use puts() or printf().
If you have a working program already, chances are you can just pipe
data into it and get stuff back out.
[Back to original message]
|