Forums

php code in confirmation page

lounger 22 Jul, 2009
I hope someone can help me and it's NOT only a php-Question:

1. I want to make a query with the value results like this. Varable output works, but not in the query:


$var1='{select_2}';
$var2='{text_1}';

if ($var1 == 'something') {
  echo "some output";
}


2. I'd like to calculate. It works, but not when i use the variables:


$var3 = number_format($var1 * $var2, 2);
echo "var3: ".$var3;


Is there anything I haven't considered?
Thanks 4 help or helpful suggestions!

And btw, but i think it's a new post: can i calculate/make variables in or for the Email Templates?
GreyHead 23 Jul, 2009
Hi lounger,

I'm not sure where you are adding this code but if $var = '{field_name}'; doesn't work then try $var = JRequest::getVar('field_name');

You can use PHP in the Email Template but you'll need to set Use HTML Editor to No in the Email Setup Properties first.

Bob
lounger 23 Jul, 2009
Thanks for your quick answer, it works!

For the sake of completeness and other users:
I use it with the Confirmation Page Plugin in the field "Confirmation page code".

Grtnx,
Lounger
This topic is locked and no more replies can be posted.