Php 如何在特定时间段(24小时)内阻止IP地址

Php 如何在特定时间段(24小时)内阻止IP地址,php,wordpress,web,ip,Php,Wordpress,Web,Ip,我有一个网站页面,在访问时,使用以下脚本将您重定向到我网站上的随机图片: <script type="text/javascript"> var urls = new Array(); urls[0] = "http://localhost/dir/wp-content/uploads/2018/05/logo.png"; urls[1] = "http://localhost/dir/wp-content/uploads/2018/05/logo2.png"; urls[2

我有一个网站页面,在访问时,使用以下脚本将您重定向到我网站上的随机图片:

    <script type="text/javascript">
var urls = new Array();
urls[0] = "http://localhost/dir/wp-content/uploads/2018/05/logo.png";
urls[1] = "http://localhost/dir/wp-content/uploads/2018/05/logo2.png";
urls[2] = "http://localhost/dir/wp-content/uploads/2018/05/logo3.png";
var random = Math.floor(Math.random()*urls.length);

window.location = urls[random];

</script>

var url=新数组();
URL[0]=”http://localhost/dir/wp-content/uploads/2018/05/logo.png";
URL[1]=”http://localhost/dir/wp-content/uploads/2018/05/logo2.png";
URL[2]=”http://localhost/dir/wp-content/uploads/2018/05/logo3.png";
var random=Math.floor(Math.random()*url.length);
window.location=URL[随机];
但是,在此之前,我想限制用户,让他们每天只能访问我的页面一次(24小时),通过阻止他们的IP地址


这是可行的还是有更好的方法?

最好对服务器进行限制。例如,在PHP$\u服务器['REMOTE\u ADDR'].

中,他们加载一次网页,然后一整天都不能再次访问它?看起来很严厉也不切实际。我会给用户一些“产品”,我想每天给一次:)那么也许你更想记住你那天给他们的是哪一个“产品”,而在剩下的时间里只继续向他们展示那一个产品?阻止IP意味着,如果我在键盘上滑了一下,太快地关闭了标签,那么我就无法纠正这个愚蠢的错误,并在一天剩下的时间里再次看到它……这是一个很好的观点。这样做的方法是什么?
IP
并不代表用户。一个IP可以有数百个用户支持它。