How to redirect user after login in Joomla 2.5

天涯浪子 提交于 2020-01-17 08:41:06

问题


I have created custom Login module in Joomla 2.5 which appears using fancybox.

Our site is using SEF URL. Now my problem is user is not redirecting to previous page where popup is trigger.

I have used following code in my module and passed it to "return" parameter of login form.

$uri =& JFactory::getURI();
$redirectUrl = urlencode(base64_encode($uri->toString()));

<input type="hidden" name="return" value="<?php echo $redirectUrl; ?>" />

But it redirect with some value appended at the end of URL and shows 404 page.

e.g.

localhost/xxx/xxxx.html

TO

localhost/xxx/xxxx.html7

回答1:


try this

$redirectUrl = base64_encode($uri->toString());




回答2:


you can remove the last character?

$char = strlen($redirectUrl) - 1;


来源:https://stackoverflow.com/questions/17269328/how-to-redirect-user-after-login-in-joomla-2-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!