简体   繁体   中英

how to redirect to current page in joomla1.5 after login

I'm working in joomla 1.5 site. When sign in, I want to redirect to current page. No need to go to index page. I'm using redirecttofirstlogin plugin to redirect to desired page. It works perfectly. But i want to pass the current page url to that link. How to take even the current url.

This will return wrong url: JURI::getInstance()->toString() .

You can use the following line to get current URL in Joomla

$current_url = JURI::getInstance();

After that you have to pass $current_url variable to desired link as per your functionality.


For Concatenate the URL, you have use this syntax,

$base_url = JURI::BASE();

For Concatenate :

$full_url = $base_url."index.php?option=com_properties&view=property&id=19&Itemid=54"; .

Try JURI::current() it will give you the current url.

Update for joomla 1.5:-

$u =& JURI::getInstance( );
echo 'URI is ' . $u->toString();

For more info you can check here- http://docs.joomla.org/JURI

If you simply want to redirect to the current page after logging in, then it can be done without any code.

In the Joomla Backend, go to the Module Manager and open the Login module. There is a parameter called "Login Redirection Page" which all you have to do is set to "Select Item" , so it's basically unselected.

I have just tested this myself and it works

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM