Forums

Redirect to Different Page

GoleyC 05 Jan, 2012
We are trying to setup a form to redirect to a different page with a thank you message on that page.

When we insert the "Redirect User (22)" the help sections says:

Enter a URL here if you want to Redirect the User after the form is submitted and processed. To set parameters in the Redirect URL, use the Configure Redirect action before this action and leave the URL here empty. This should be the last action in the OnSubmit Event.



We cannot find the Configure Redirect action. So the question is, can we setup a redirect url to a page we create in Joomla articles to include a Thank you message?

Craig
GreyHead 05 Jan, 2012
Hi GoleyC,

If you always want to redirect to the same URL then use the ReDirect User action and put the URL in there.

You only need the second action if you want to reidrect to a variable URL depending on the form results. The action to do that is called 'ReDirect URL' now and it is in the CURL actions group (because it does something similar to the cURL action).

Bob
s_meliana 25 Jun, 2012

Hi GoleyC,

If you always want to redirect to the same URL then use the ReDirect User action and put the URL in there.
Bob



Hi Bob,
Is it possible to redirect to the same URL after thanks message.
For example, thanks message will appear around 10 seconds, after that page automatically go to different page.
GreyHead 25 Jun, 2012
Hi s_meliana,

Here you are:
Drag in to the On Submit action first a Custom Code action; then a Show Thanks Message action.

Add whatever message you like to the Show Thanks Message action (you can include form data by using input names in curly brackets) and save.

Open the Custom Code action and add this snippet:
<?php 
$doc =& JFactory::getDocument();
$doc->setMetaData('refresh', '10;http://some_url', 'true');
?>

Replace the 10 with the number of seconds that you want the form to delay before redirecting.

Bob

This is an extract from a tutorial I have for sale on redirecting users and data to other sites.
renas 26 Jul, 2012
Hi,

I have tried this solution. with a custom code and next a Thanks Message.

Does it need anything more.
doesn't work for me,😟

Tks,

Renas
GreyHead 27 Jul, 2012
Hi Renas,

No nothing else is required. What code are you using exactly?

Bob
renas 27 Jul, 2012
Hi GreyHead,

I'm using this code:

<?php 
$doc =& JFactory::getDocument();
$doc->setMetaData('refresh', '10;http://mysite.domain.com', 'true');
?>


Tks,

Renas
GreyHead 28 Jul, 2012
Hi Renas,

That looks good and it works OK here.

Where have you put the code?

Bob
lowrykun 10 Oct, 2012
Your solution is missing the "URL=" before the URL. It didn't work for me until I added it.

<?php 
$doc =& JFactory::getDocument();
$doc->setMetaData('refresh', '10;URL=\'http://mysite.domain.com\'', 'true');
?>
GreyHead 11 Oct, 2012
Hi Renas,

Thank you, this look like another example where IE sticks to the rules and requires the URL= while other browsers will work OK without it.

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