关于wordpress获取用户真实IP,存于本地数据库——实现首次访问警告提示的功能

该博客介绍如何在WordPress中实现一个功能,当用户首次访问网站时显示Cookie警告栏,用户接受后缓存该行为,不再重复显示。内容包括判断用户IP是否存在,存储IP至数据库的PHP和AJAX实现,以及如何使用cPanel新建数据表存储用户IP。

《需求摘要》
英:The yellow bar at the bottom of the page is the cookie warning .
It just needs to be a bar with CTA in it for people to click accept. Once accepted this will be cached and not pop up again .
So only needs to display on first visit .
Is closing this warning equivalent to accepting it.
As is moving to a new page from the homepage .
this isn’t needed,the cache can be indefinite.
and only refresh when user chooses to refresh.
A user can refresh their internet cache manually.
It can be by IP but for personal cache data on the machine as well.
Also please add the forex sentiment javascript to the Forex page .
Ip no login required this is for all visitors to the site .
中文翻译:页面底部的黄色栏是cookie警告。
它只需要是一个带有CTA的栏,供人们点击接受。 一旦被接受,这将被缓存而不会再次弹出。
所以只需要在第一次访问时显示。
关闭此警告相当于接受它。
正如从主页转移到新页面。
这不是必需的,缓存可以是无限期的。
并且仅在用户选择刷新时刷新。
用户可以手动刷新其Internet缓存。
它可以通过IP,但也可以用于机器上的个人缓存数据。
另外,请将外汇情绪javascript添加到外汇页面。
不需要登录,这适用于网

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值