Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在登录后重定向到joomla1.5中的当前页面_Joomla_Joomla1.5 - Fatal编程技术网

如何在登录后重定向到joomla1.5中的当前页面

如何在登录后重定向到joomla1.5中的当前页面,joomla,joomla1.5,Joomla,Joomla1.5,我在joomla 1.5网站工作。登录时,我想重定向到当前页面。无需转到索引页。我正在使用redirecttofirstlogin插件重定向到所需页面。它工作得很好。但我想将当前页面url传递到该链接。如何获取当前url 这将返回错误的url:JURI::getInstance()->toString()您可以使用以下行获取Joomla中的当前url $current_url = JURI::getInstance(); 之后,您必须根据您的功能将$current\u url变量传递到所需的链

我在joomla 1.5网站工作。登录时,我想重定向到当前页面。无需转到索引页。我正在使用redirecttofirstlogin插件重定向到所需页面。它工作得很好。但我想将当前页面url传递到该链接。如何获取当前url


这将返回错误的url:
JURI::getInstance()->toString()

您可以使用以下行获取Joomla中的当前url

$current_url = JURI::getInstance();
之后,您必须根据您的功能将
$current\u url
变量传递到所需的链接


要连接URL,必须使用以下语法:

$base_url = JURI::BASE();
对于串联:


$full\u url=$base\u url.“index.php?option=com\u properties&view=property&id=19&Itemid=54”

您可以使用以下行获取Joomla中的当前URL

$current_url = JURI::getInstance();
之后,您必须根据您的功能将
$current\u url
变量传递到所需的链接


要连接URL,必须使用以下语法:

$base_url = JURI::BASE();
对于串联:

$full\u url=$base\u url.“index.php?option=com\u properties&view=property&id=19&Itemid=54”

试试
JURI::current()
它会给你当前的url

joomla 1.5的更新:-

$u =& JURI::getInstance( );
echo 'URI is ' . $u->toString();
有关更多信息,请查看此处-

尝试
JURI::current()
它将为您提供当前url

joomla 1.5的更新:-

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

有关更多信息,您可以在此处查看-

如果您只想在登录后重定向到当前页面,则无需任何代码即可完成

在Joomla后端,转到模块管理器并打开登录模块。有一个名为“登录重定向页面”的参数,您只需将其设置为“选择项”,因此它基本上未被选中


我自己刚刚测试过,它可以工作

如果你只是想在登录后重定向到当前页面,那么就可以不用任何代码

在Joomla后端,转到模块管理器并打开登录模块。有一个名为“登录重定向页面”的参数,您只需将其设置为“选择项”,因此它基本上未被选中


我自己刚刚测试过,它可以工作

例如,我需要“$base\u url”+/index.php?option=com\u properties&view=property&id=19&Itemid=54。为此,使用getInstance(),我只能得到“$base\u url”+/index.php?option=com\u properties&view=property&Itemid=54。。。它留下id=2。例如,我需要“$base\u url”+/index.php?option=com\u properties&view=property&id=19&Itemid=54。为此,使用getInstance(),我只能得到“$base\u url”+/index.php?option=com\u properties&view=property&Itemid=54。。。它留下id=2.0。对不起,irfan。这将只返回基本url。例如mywebsite.com/index.php。但我需要完整的url。@BharathRam:是的,它在joomla1.5中不起作用。但在joomla2.5中起作用。我的错误,我没有在1.5中测试它。请检查我的更新答案,这可能对你有帮助。对不起,irfan。这将只返回基本url。例如mywebsite.com/index.php。但我需要完整的url。@BharathRam:是的,它在joomla1.5中不起作用。但在joomla2.5中起作用。我的错误是,我没有在1.5中测试它。请检查我的更新答案,这可能会对您有所帮助。