Home > Backend Development > PHP Tutorial > 怎么让某个地区的人访问 网站的时候,不加载统计代码?

怎么让某个地区的人访问 网站的时候,不加载统计代码?

WBOY
Release: 2016-06-23 14:02:37
Original
906 people have browsed it

怎么让某个地区(比如西宁)的人访问 网站的时候,不加载统计代码;
其他地区的ip访问时,加载统计代码?



回复讨论(解决方案)

在统计加载统计代码的js的前面加if条件判断。至于哪些ip段属于哪些省份,这个需要查询一些资料哦。

获取ip 根据ip获取地域 最后进行判断

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template