问题
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