如何在Codeigniter中获取上一页URL [英] How to get previous page url in codeigniter

查看:58
本文介绍了如何在Codeigniter中获取上一页URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在一个变量中私下访问页面url并在控制器中找到它。有什么办法找到它的吗?请帮助我。通过使用以下代码
redirect($ this-> agent-> referrer());

I need privously visited page url in a variable and to find it inside a controller. is there any way to find it?please help me.By using following code redirect($this->agent->referrer());

i可以重定向到上一页。但是我需要在变量中进行检查。

i can redirected to the previous page .but I need this inside a variable to check.

推荐答案

请尝试以下操作:

$this->load->library('user_agent');
if ($this->agent->is_referral())
{
    $refer =  $this->agent->referrer();
}

通过这种方式,您加载 user_agent 库,检查是否存在引荐网址,然后将其存储到变量中以在之后使用它

In this way you load user_agent library, check if there is a referral url and then store It into a variable to use It after

这篇关于如何在Codeigniter中获取上一页URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆