Re: Running CLI from a web page

From: Date: Tue, 11 Nov 2003 01:27:46 +0000
Subject: Re: Running CLI from a web page
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-169120@lists.php.net to get a copy of this message
Ron -- ..and then Ron Rudman said... % % I have a php cli that creates a file. It works fine when I execute it from % the Linux command line as "php foo > bar". I'm trying to also execute this OK. % by clicking a form button on a web page via "system('php foo > bar')". I Odd, as some have said, but fair enough :-) % can see that the file bar gets created but it's always empty. I've tried What should be in it? How does it get in there? Why might it not get in there? Where is it that it should get in there? % executing "system('php foo')" (directly to STDOUT) but get no output. I've % tried "exec('php foo',$output)" but there's nothing in the array when it's % done. What about passthru()? Note that system() only returns the last line -- and so if that's a blank you won't see anything. % % Suggestions??? Try the above. % % BTW, wherever I've written "php" above I've actually used the full path of % the php executable. Then you should have written that ;-) HTH & HAND :-D -- David T-G * There is too much animal courage in (play) davidtg@justpickone.org * society and not sufficient moral courage. (work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

« previous php.general (#169120) next »