Forums

error php code in custom

jaccies 13 Mar, 2016
Hello,

I am using Chronoforms v4 in Joomla 2.5 website,
this website i build from scratch with Joomla 3.4.8 with Chronoforms v5, and
building new forms with some code from chronoforms v4 .

This code works in chronoforms v4 in Formatted Text Element:
<?php
// Get user-information from Joomla
$user = &JFactory::getUser();
?>
<p><span style="font-family: arial,helvetica,sans-serif;">
<strong><span style="color: #0000ff; font-size: large;">Hello <?php echo $user->name; ?></span></strong></span></p>

this shows Hello < name of cuurent user logged in > in the form

I have read that the Custom element in V5 is the same as Formatted Text from v4
but that code above gives me an error and does not show the <name of current user> but error :
administrator/components/com_chronoforms5/chronoforms/actions/html/html.php(263) : eval()'d code on line 3

what could be the solution?
Thanks
Jac
GreyHead 14 Mar, 2016
HI Jac,

Please remove the & from line 3 of the custom code - there have been some changes in PHP.

Bob
jaccies 14 Mar, 2016
Hi Bob,

it works now thanks, old website had PHP 5.3 and new one now 5.4

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