procmail
[Top] [All Lists]

getting the exit code from a php script

2006-09-19 06:14:18
Dear Procmailer

i try to run a php script from procmail to update some fields in a MySQL 
database.


for this i use a recipe like :

:0 
*  ? php  /script.php \
$X_FIELD1   $X_FIELD2  
{
 LOG = "$NL ======> \
 DATABASE UPDATE : \
 $X_FIELD1   $X_FIELD2 \
<====== $NL" 
}

i get $X_FIELD1  $X_FIELD2 into php with: 

$field1 = $argv[1]; 
$field2 = $argv[2];

fine , my php script end with exit(0); 
if sucessfull and with exit(2) if there
was an error updating the MySQL Database.


the problem now is if $X_FIELD1 contains more 
then one word with spaces in between  and not
only one word it will fill $field1 with the first word and 
$field2 with the second.

i thought  " are the solution:) 

:0 
*  ? php  /script.php \
"$X_FIELD1"  "$X_FIELD2"  
{
LOG = "$NL ======>  \
DATABASE UPDATE : \
$X_FIELD1   $X_FIELD2 \
<====== $NL" 
}

Ok, thats pass all words in 
"$X_FIELD1" to php $field1 = $argv[1];
and 
"$X_FIELD2" to php $field2 = $argv[2];


but now i have always a  0 exitcode no 
matter if the php script exit with 0 or 2 

can anybody explain please 


Matthias


 

  







____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>