Hi,
My problem is redirecting a submitted multilingual form. I have already searched this forum which has helped me along a bit
My problem is redirecting a submitted multilingual form. I have already searched this forum which has helped me along a bit
<?php
$rows[0]->redirecturl = $url;
$lang =& JFactory::getLanguage();
switch ( $lang->getName() ) {
case 'fr-FR':
default:
$url = "http://www.mysite.com/fr/merci";
break;
case 'en-EN':
$url = "http://www.mysite.com/en/thankyou";
break;
}
?>
I have put this code in "custom code." The form submits but goes to a blank page (url reads along the lines of "chronoforms form submit"). However the site stays in the correct language so the language side of the script is working but it's not redirecting.
Hi Gareth,
You could just add code like this to a Custom Code action and let ChronoForms display it.
If you want to redirect I'd use the Joomla! method here
Bob
You could just add code like this to a Custom Code action and let ChronoForms display it.
If you want to redirect I'd use the Joomla! method here
<?php
$rows[0]->redirecturl = $url;
$lang =& JFactory::getLanguage();
switch ( $lang->getName() ) {
case 'fr-FR':
default:
$url = "http://www.mysite.com/fr/merci";
break;
case 'en-EN':
$url = "http://www.mysite.com/en/thankyou";
break;
}
$app = \JFactory::getApplication();
$app->redirect($url);
?>
Bob
This topic is locked and no more replies can be posted.