Forums

Chronoforms thank you message and redirect

FoxMulder 02 Jun, 2014
Hello everybody,
I have got a debug problem while I was testing a redirecting php code after a thank you message.
As I have seen on previous Chronoform tutorials I have used this code to redirect the page after message submitting:

<?php
$doc =& JFactory::getDocument();
$doc->setMetaData('refresh', '5;url=http://example.com/index.php', 'true');
?>


The redirect is working well, the thank you message is correctly displayed too, however I got this error after the thank you message:

Only variables should be assigned by reference [path of the theme]/custom_code/custom_code.php(20) : eval()'d code on line 2

Anyone can help me to understand this ?

Thank you and have a nice day !
GreyHead 02 Jun, 2014
Answer
1 Likes
Hi FoxMulder,

It's just a warning and can be hidden by setting the Site Error Reporting to System Default or None in the site Global Configuration. If you want to fix it, change this line
$doc =& JFactory::getDocument();
to
$doc = JFactory::getDocument();
i.e. remove the &

Bob
FoxMulder 02 Jun, 2014
Hello Greyhead,
thank you very much ! It worked perfectly !
This topic is locked and no more replies can be posted.