如何知道用户从哪个网页进入了我们的网站 [英] how to know from which web page the user has entered into the oursite

查看:155
本文介绍了如何知道用户从哪个网页进入了我们的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何知道用户从哪个网页进入了我们的网站.

我有一个要求,我必须知道用户从哪个网页进入了网站.例如,我有三个页面,第1页,第2页和默认页面.在两个页面中,我有指向默认页面的链接...我必须知道用户从哪个页面输入了默认页面,无论他是从第1页还是从第2页输入的. ...


在此先感谢..
Sirisha

how to know from which web page the user has entered into the oursite.

i have a requirement where i have to know from which webpage the user has entered the site. for example i have three pages,page1,page2 and default page.. in two pages i have link to the default page... i have to know from which page the user has entered default page whether he has entered from page1 or page2....


thanks in advance..
Sirisha

推荐答案

尝试以下操作:
Try this:
Request.ServerVariables["HTTP_REFERER"];


请注意,这不会在100%的时间内填充.由浏览器将这些信息发送到服务器.即使正常情况下,某些偏执狂防火墙软件也会阻止此数据进入http请求.有关非可靠性的更多详细信息,请参见: http://classicasp .aspfaq.com/general/what-is-wrong-with-request-servervariables-http-referer.html [


Note this will not be populated 100% of the time. It''s up to the browser to send this information to the server. And even if it does under normal circumstances, some paranoia firewall software prevents this data from going in http requests. More details on the non-reliability here: http://classicasp.aspfaq.com/general/what-is-wrong-with-request-servervariables-http-referer.html[^]


最简单的方法是将页面本身的一些逻辑.
将其捕获到page_load事件中,并将其存储在数据库中,或将此值传递给进一步处理.
The easiest way would be to put some logic in the page itself.
Trap this in the page_load event and store this in the database or pass this value on for further processing.



我认为,您可以在页面本身中跟踪用户信息..因为只有您才能获取信息.或者,如果您正在使用该页面(使用请求对象查找当前网址),也可以在母版页中尝试此操作.或者尝试跟踪会话的创建时间,并将其与用户访问每个页面的时间进行比较,因此这里的时间跨度较小.它将声明用户输入了哪个页面,默认页面或他是从page1还是page2输入的.
并且请让我知道它是否有效.否则,我会尝试找到更好的解决方案.

试试吧.最好.
Hi,
As I think, You can track the user information in the pages itself.. Because there only you''ll get the information. Or you can also try this in master page if you are using that(Use request object to find the current url). Or Try to track the session creation time and compare it with the time when user visits each and every page, so here the less timespan you got. It will declare which page the user has entered, default page or whether he has entered from page1 or page2.
And please let me know if it works. Otherwise I''ll try to have a better solution.

Try this.. All the best.


这篇关于如何知道用户从哪个网页进入了我们的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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