Forums

operation arithmetics in template email chronoform

javierrios@cantv.net 01 Jul, 2011
Hello

Please help me

- I need make the operation arithmetics into e-mail template, because I should multiply a variable for costant

In my form I have a textbox and your name textbox is variable , for example into in the textbox the number 5 and after click in the submit button

This is my code in mail template
The variable is = {variable}

<?$datavariable='{variable}';?>
</br>
Variable in php =<?echo $datavariable;?>
</br>
Result one =  <?echo 35*$datavariable ;?>


<?$costo=(integer)"35";?>
</br>

Result Two<?echo $costo*$datavariable ?>


When arrive the new mail in the context I have

The variable is = 5

Variable in php = 5

Result one = 0

Result two = 0


I dont understand because I can't multiply

Thanks
GreyHead 02 Jul, 2011
Hi [email]Javierrios@cantv.net[/email],

Usually you can't use the {variable} syntax in PHP. Please try using $form->data['variable'] for calculations instead
The variable is = {variable}

<?$datavariable=$form->data['variable'];?>
</br>
Variable in php =<?echo $datavariable;?>
. . .



Bob
javierrios@cantv.net 02 Jul, 2011
Hey

I was crazy because don't working

after the new code

Working Fine !!!!!!!!!!!!

Thanks 8)
This topic is locked and no more replies can be posted.