简体   繁体   English

Codeigniter中如何检测来自用户的URL?

[英]How to detect URL from user came in Codeigniter?

How to detect URL from user came in Codeigniter? Codeigniter中如何检测来自用户的URL?

For example, I am at page: /contact/ , after click the link with url /news/ at controller news I must detect the previous URL /contact/ 例如,我在页面上: / contact / ,在控制器news单击带有URL / news /的链接后,我必须检测到先前的URL / contact /

You can probably grab the referring page using the PHP $_SERVER array. 您可能可以使用PHP $_SERVER数组来获取引用页面。

See: http://php.net/manual/en/reserved.variables.server.php 请参阅: http//php.net/manual/en/reserved.variables.server.php

Specifically: HTTP_REFERER 具体来说: HTTP_REFERER

You may need to parse the string to get the part that you need. 您可能需要解析字符串以获取所需的部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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