Login redirection help

gabedaly 28 Mar, 2013
Using CF 4.0 RC3.5.2 I have a form that sends a dynamic link with parameters (token) in an email. When I click on the link in the email, it brings me to a login (if I'm not logged in already). What I can't figure out is how to redirect back to the original link after I log in as the links are dynamic. Any suggestions. Thanks.
One more thing...I managed to get the referring url into the login form->data but not sure how to use it to redirect back🤨
Gabe
GreyHead 28 Mar, 2013
Hi Gabe,

Hmm, I thought that the Joomla Login kept the previous URL (but I may be thinking of something else). I don't think that there is anything much here that you can do with ChronoForms even if you used a ChronoForms login form.

Bob

PS I found a hack for Joomal 2.5 here - from a quick read it looks as though you could implement that in a ChronoForms form and use that instead of the Joomla! login form.
gabedaly 28 Mar, 2013
Finally figured it out!
Using sessions, I was able to use the referring url with this code:

<?php
$mainframe =& JFactory::getApplication();
$ref = $form->data['referer'];
$url = "https://www.mysite.com$ref";
$mainframe->redirect($url);
?>


Hope it helps someone else too.
GreyHead 29 Mar, 2013
Hi Gabe,

Neat, well found :-)

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