0
votes

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
2
try without urlencode. - Jobin
on a side note, you don't need to use & - Lodder

2 Answers

0
votes

try this

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

0
votes

you can remove the last character?

$char = strlen($redirectUrl) - 1;