PHP如何找到用户来自哪里? [英] php how to find the location where a user came from?

查看:78
本文介绍了PHP如何找到用户来自哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简单的问题:

how to find the location (url) where a user came from before accessing my page?

how to find the location (url) where a user goes after exiting my webpage?

我应该从哪里开始的任何想法? 谢谢

any ideas where i should start? thanks

推荐答案

在PHP中,您可以使用$ _SERVER ['HTTP_REFERER']来了解用户来自何处.

In PHP, you can use the $_SERVER['HTTP_REFERER'] to know where the user came from.

没有机制可以知道用户的去向,除非他们单击您网站上的链接以离开您的页面. (如果您要跟踪的是这种退出方式,则需要依靠javascript并实施类似Google Analytics(分析)出站链接跟踪的方法:http://www.google.com/support/analytics/bin/answer.py?answer=55527 )

There is no mechanism to know where the user is going, unless they clicked a link on your site to leave your page. (If that is the kind of exit that you want to track, you'll need to rely on javascript and implement something like Google Analytics outbound link tracking: http://www.google.com/support/analytics/bin/answer.py?answer=55527)

这篇关于PHP如何找到用户来自哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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