如何捕获访问者访问mysite中的信息 [英] how to capture the visitors visited information in mysite

查看:88
本文介绍了如何捕获访问者访问mysite中的信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在数据库中维护有关访客在我的网站内所做的事情的数据。我的意思是说我有娱乐网站第一次用户进入我的网站,选择花卉图像我只是捕获该信息并将其存储在数据库中。当同一个用户打开我的网站时,我需要显示他上次访问的图像。我想根据访问者的IP地址做这个。请指导我该如何开始?

i want to maintain data in database regarding what visitors doing inside my website. i mean to say i have entertainment website first time user enters into my website,select images like flowers i just capture that information and store it in database.When same user open my website i need to display the images what he visited last time. i want to do this based on ip address of visitors. please guide how can i start this?

推荐答案

您可以使用一个密钥将用户的浏览数据存储到浏览器缓存中,该密钥稍后可用于显示之前的浏览数据。





许多电子商务这样做可以填充收藏品:最近访问过的产品。



如果你将浏览历史存储在你的数据库中,那么你需要管理它的开销,因为同一个用户可能永远不会返回,也不是每个用户都使用静态IP。



你可以在servlet上看到这个: http://www.topshop.com / [ ^ ]
You can store the user''s browsing data into browser cache with a key which can later be used to display the previously browsed data.


Many E-Commerce do this to populate collection''s like: Recently Visited Product.

And also if you store the browsing history in your DB then its overhead for you to manage this, as same user may not return for forever also not every user uses static IP.

And you can see this in action in servlets on : http://www.topshop.com/[^]


您无需在服务器上存储任何信息。只需在客户端的PC上创建一个cookie。检查页面加载是否存在。如果存在则从中读取存储的项目并相应地填充页面上的项目。如果没有,则在搜索项目时创建新的cookie。这更适合您的需要。
You don''t need to store any information on your server. Just create a cookie on client''s PC. Check on page load if it exist or not. If it exist read the stored item from it and populate the items on page accordingly. If it does not, on searching the items create a new cookie. This is what suits more to your need.


这篇关于如何捕获访问者访问mysite中的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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