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.
hope helps.
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
Post a Comment