Redirect method $app->redirect doesn't work

Perino

New Member
Hi 2all!

Environment: Joomla 2.5.3
Fabrik: 3.04 latest update from GitHub
PHP Version 5.3.6-13ubuntu3.6

I have a Fabrik Form which includes a php Plugin. The goal of the php File is to redirect to another Url, but the redirect doesn't work.

<?php
defined('_JEXEC') or die();
$app = JFactory::getApplication();
$link = 'http://www.vertrend.com';
$msg = 'you have been redirected!';
$app->redirect($link, $msg, $msgType='message');
?>

When i submit with the form button, it seems that the script will be fired, but nothing happens. After changing to another article within Joomla, the Message 'you have been redirected!' appears on the top of the page. But no redirect to the other url at all?!

Why does the redirect not work? Does anybody have a clue?


Thx
 
I have also tried the variant $app->redirect($link, $msg);
$app->redirect($link);

same result, no redirection!
 
What event do you have the php running on? are you sure the code is actually being run? If you add a

Code:
echo "here I am";
exit;
do you see "here I am" out putted?
 
Hi Rob!

Thank you for your reply! The event will be triggered through
'End of form submission (onafterprocess)'

I added the echo lines, but no output when the Submit Button will be executed!

Strange, because the calculation from the Fabrik Calc Modul will be done, the result of the calculation is written to the database. Even in my code, which is posted in the begin of the thread, the Messagetitle of the redirection will be displayed after Submitting, when I manually change to another site.

What could be the problem?
 
Just out of interest, is there any particular reason you are doing this with your own PHP form plugin, rather than the using the existing 'redirect' plugin?

-- hugh
 
I have a Farbik form with several radio buttons.
Each radio button will be rated with a value.
The values of all radio buttons will be summarized in a separat Fabric calc plugin field (called result).
By submitting the form, the result will be written into the database => This will be done.
In the next step, the user shoult be redirected to a form, which illustrates him the result.
I had realized this, with a small php skript. Any other possibilites would be very welcome.
 
Does someone has a solution for this ?
i 've the same problem i have a payment script
which gives the link to the Payment site back to which the user should be redirected.

only the redirect doesn't work

After data stored, before calculations (onBeforeCalculations)

PHP:
$app = JFactory::getApplication();
$link = $result->getUrl();
$app->redirect($link);

but it seems that as response a json script is expected.

does anybody know how i can redirect after the script to a dynamic URL
which is generated in the script.

or can i somehow use the URL in the redirect script ?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top