RE: [PHP] RE: PHP Command line question

From: Date: Mon, 10 Jul 2000 15:08:58 +0000
Subject: RE: [PHP] RE: PHP Command line question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-5740@lists.php.net to get a copy of this message
if you want /usr/sbin/sendmail to: email | /path/to/phpscript your php script would start out like. #!/usr/bin/php -q <? $program = argv[0]; $email = argv[1]; $body = argv[2]; etc, etc... its just like C style inputs. -----Original Message----- From: J. Geusebroek [mailto:php@intercept.cx] Sent: Monday, July 10, 2000 4:53 AM To: bhorton@pneumasoft.com; php-general@lists.php.net Subject: RE: [PHP] RE: PHP Command line question Hi, >Well, if I assume nothing about how the other program is triggered, one way >would be if PHP could trigger the other program. Then it would be fairly >simple to have PHP call the other program and capture the output for >examination. This of course assumes a number of things but it does provide >1 idea about how it could be done. The program is triggerd by sendmail; I want a script to parse the output of an email by using |/some/script in /etc/aliases. So it's not possible for PHP to trigger the other program. >Another possibility might be to have the information pipe to a file which is >then passed to PHP for examination. Or use a specific directory so PHP >would examine all the information in the files in that directory and delete >them once completed. I fixed it using a PERL script. PERL redirects the data to a text file and the name of the text file is set into an argument. The perl scripts then starts the PHP script with the name of the textfile send as an argument. I would rather have another 'cleaner' solution, but hey, it works :) Regards, Jeroen Geusebroek > -----Original Message----- > Hi there, > > I have compiled PHP standalone. I want to redirect the output of another > program > to PHP. My PHP script must then examine the output and insert the > information in a > database. > > If i redirect the output of a program using |, how can i get my PHP script > to get the > information? > > Thanks in advance, > > Jeroen Geusebroek > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#5740) next »