Logout + redirect + message not possible

tritongr

New Member
In a form's onAfterProcess PHP I have this code:

1. $app = JFactory::getApplication();
2. $app->logout();
3. $app->redirect("/success", "Successful save");
4. return true;
Works partially. User redirected to /success page and logged out, but no message appear.

Following I swap lines 2 and 3,
1. $app = JFactory::getApplication();
2. $app->redirect("/success", "Successful save");
3. $app->logout();
4. return true;
Works partially. User redirected to /success page and message appear but no logout executed

Is it possible to achieve all 3? Redirect, message and logout?
 
This is Joomla, not Fabrik.
You can add messages with
$app->enqueueMessage("your text");
 
Thanks troester for the reply,

but I try the following code without success on displaying the message "All good".
Logout + redirect goes ok.
$app = JFactory::getApplication();
$app->enqueueMessage("All good");
$app->logout();
$app->enqueueMessage("All good");
$app->redirect("/success", "Successful save");
$app->enqueueMessage("All good");
return true;

The reason I need PHP for sending the message to the redirect page, is that I have to include some form field values (using placeholders etc).
 
In fact after form submission I would like to logout the user and redirect to a page displaying some of the choices has made.
Something like this: "You successfully submit the following choices ..."
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top