How to redirect to the originating page after login - Joomla! Forum - community, help and support


sometimes need ask users login first before giving access site, , need redirect them page after login. can done appending url return variable.

code: select all

$return = base64_encode(jroute::_('index.php?option=com_content&view=articles&id='.(int)$article->id));
if(!$user->id) {
$app->setredirect(jroute::_('index.php?option=com_users&view=login&return='.$return'));
}


hope helps.

flimh wrote:sometimes need ask users login first before giving access site, , need redirect them page after login. can done appending url return variable.

code: select all

$return = base64_encode(jroute::_('index.php?option=com_content&view=articles&id='.(int)$article->id));
if(!$user->id) {
$app->setredirect(jroute::_('index.php?option=com_users&view=login&return='.$return'));
}


hope helps.

thanks code sir, looking out such , found answer. surely try out.





Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

PProHeadless.exe has stopped working error when opening projects in Adobe Media Encoder CS6

Preconditions Failed. - Joomla! Forum - community, help and support