Forums

PHP Code Not Working

LikeStuff 24 Aug, 2011
This code doesn't seem to work in the new version. I made sure that the names on the form matches the template and they do. Any idea what I need to change to make it work.

<?php
if ( $posted['Name'] ) {
  echo '{Name}';
}
?>


ChronoForms: 4.0 RC1.9

Thanks!!
GreyHead 24 Aug, 2011
Hi LikeStuff,

Where exactly are you trying to use this?

In ChronoForms v3 I think this only worked when the Multi-Page plug-in was being used.

In ChronoForms v4 please try $form->data['Name'] for example
<?php
if ( $form->data['Name'] ) {
  echo 'Name: '.$form->data['Name'];
}
?>

Bob
LikeStuff 24 Aug, 2011
I'm using this in my template. I did not want the field name to show if no content is entered.
This works - thank you!!😀
This topic is locked and no more replies can be posted.