|
Posted by Mike Willbanks on 10/20/05 03:02
weberjacob@gmail.com wrote:
> I'm using PHP in command-line mode. I would like to run an external
> command, and have it interact with the user just as if he had ran it
> from a shell. (I don't need my script to send input to the command).
> Ideally I would also like to capture the STDOUT into a variable,
> although this is not a requirement.
>
> None of the PHP program-execution commands seem to work for me. The
> closest I've come is:
> system("ftp")
> which takes user input, but it seems to buffer the output until you
> type something other than a carriage return. I want it to behave
> exactly as it does from a shell. Is this possible?
>
> Thanks,
> Jacob
>
Take a look at proc_open.
http://www.php.net/proc_open
--
Mike Willbanks
Zend Certified Engineer
http://www.digitalstruct.com
Navigation:
[Reply to this message]
|