Forums

PHP getting commented out

liamhanks 10 Feb, 2017
Hi,
When setting up my form 'on submit' actions, any actions that allow the text editor option (for example, Display Message or Email (message content), I'm unable to include any php, as the opening tags (and any following 'greater-than' tags) are getting converted to HTML comments, even if the editor is disabled.

For example:
<?php if($form->data['name'] === ""){do something;}


becomes:
<!-- php if($form- --/>data['name'] === ""){do something;}


...which aside from creating some funky output, is completing trashing my ability to dynamically display fields in thank-you messages and emails. Obviously something is rewriting the output, but I'm at a loss to determine what. I've even disabled TinyMCE altogether in Joomla, but still no luck.

I'm using the latest CF on joomla 3.6.5. I haven't added the Joomla Plugins action to the form. I can provide more details about installed extensions, etc. if needed.

I'd greatly appreciate any thoughts or suggestions.

Thanks
GreyHead 10 Feb, 2017
Hi usainteanne,

You can't use PHP where there is a WYSIWYG editor.

For the Thank you message use a Custom Code action - no editor but does accept PHP and the output is the same.

For the Email either turn off the editor or create the custom HTML in a Custom Code action before the email and save the result to the $form->data array as e.g. $form->data['some_html'] you can then put {some_html} in the Email template.

Bob
liamhanks 14 Feb, 2017
Hi Bob,
putting all the PHP is custom code actions and using curly brackets in the WYSISWYG boxes appears to work perfectly.

Thanks for the quick response!
This topic is locked and no more replies can be posted.