wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.8.tar.gz ./configure make make install
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz gunzip GeoIP.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz gunzip GeoLiteCity.dat.gz
geoip_country GeoIP.dat; geoip_city GeoLiteCity.dat;
if ($geoip_country_code = CN) {
deny all;
}
$geoip_country_code #两位字符的英文国家码。如:CN, US $geoip_country_code3 #三位字符的英文国家码。如:CHN, USA $geoip_country_name #国家英文全称。如:China, United States
$geoip_city_country_code #也是两位字符的英文国家码。 $geoip_city_country_code3 #上同 $geoip_city_country_name #上同. $geoip_region #这个经测试是两位数的数字,如杭州是02, 上海是 23。但是没有搜到相关资料,希望知道的朋友留言告之。 $geoip_city #城市的英文名称。如:Hangzhou $geoip_postal_code #城市的邮政编码。经测试,国内这字段为空 $geoip_city_continent_code #不知什么用途,国内好像都是AS $geoip_latitude #纬度 $geoip_longitude #经度
fastcgi_param GEOIP_COUNTRY_CODE $geoip_country_code; fastcgi_param GEOIP_COUNTRY_CODE3 $geoip_country_code3; fastcgi_param GEOIP_COUNTRY_NAME $geoip_country_name; fastcgi_param GEOIP_CITY_COUNTRY_CODE $geoip_city_country_code; fastcgi_param GEOIP_CITY_COUNTRY_CODE3 $geoip_city_country_code3; fastcgi_param GEOIP_CITY_COUNTRY_NAME $geoip_city_country_name; fastcgi_param GEOIP_REGION $geoip_region; fastcgi_param GEOIP_CITY $geoip_city; fastcgi_param GEOIP_POSTAL_CODE $geoip_postal_code; fastcgi_param GEOIP_CITY_CONTINENT_CODE $geoip_city_continent_code; fastcgi_param GEOIP_LATITUDE $geoip_latitude; fastcgi_param GEOIP_LONGITUDE $geoip_longitude;
<?php $geoip_country_code = getenv(GEOIP_COUNTRY_CODE); $geoip_country_code3 = getenv(GEOIP_COUNTRY_CODE3); $geoip_country_name = getenv(GEOIP_COUNTRY_NAME); $geoip_city_country_code = getenv(GEOIP_CITY_COUNTRY_CODE); $geoip_city_country_code3 = getenv(GEOIP_CITY_COUNTRY_CODE3); $geoip_city_country_name = getenv(GEOIP_CITY_COUNTRY_NAME); $geoip_region = getenv(GEOIP_REGION); $geoip_city = getenv(GEOIP_CITY); $geoip_postal_code = getenv(GEOIP_POSTAL_CODE); $geoip_city_continent_code = getenv(GEOIP_CITY_CONTINENT_CODE); $geoip_latitude = getenv(GEOIP_LATITUDE); $geoip_longitude = getenv(GEOIP_LONGITUDE); echo 'country_code: '.$geoip_country_code.'<br />'; echo 'country_code3: '.$geoip_country_code3.'<br />'; echo 'country_name: '.$geoip_country_name.'<br />'; echo 'city_country_code: '.$geoip_city_country_code.'<br />'; echo 'city_country_code3: '.$geoip_city_country_code3.'<br />'; echo 'city_country_name: '.$geoip_city_country_name.'<br />'; echo 'region: '.$geoip_region.'<br />'; echo 'city: '.$geoip_city.'<br />'; echo 'postal_code: '.$geoip_postal_code.'<br />'; echo 'city_continent_code: '.$geoip_city_continent_code.'<br />'; echo 'latitude: '.$geoip_latitude.'<br />'; echo 'longitude: '.$geoip_longitude.'<br />';
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有