Forums

Correct Syntax for PHP in Display Message

JerseyGirl 30 Jun, 2016
Hi,
I would like to put some data from the form into the display message after form submission, similar to what I do with emails.

If I just copy the code from my email action to my display message action, the html displays properly but I the PHP I wrote for email doesn't work in the display message - a portion of the actual code is displayed in the browser.

Here's a simple statement that does what I want for email but not in display message:
<?php
if ($_REQUEST['apples'] == 1)
{
echo 'I want 1 apple.';
}
elseif ($_REQUEST['apples'] > 1)
{
echo 'I want more than 1 apple.';
}
?>
"apples" is a dropdown with values of 1, 2, or 3.

I tried switching $_REQUEST to $form->data (based on something I read in FAQ) but that didn't seem to help.

What would be the correct syntax for this?

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