Tags
I tried to find out a solution how we can block or trace visitor location and based on that location we do some action
First you have to use 3rd party api to get visitor location. The following url will give you the detail.
http://ipinfodb.com/ip_location_api.php
Lets assume the visitor ip is 180.234.12.237 (you’ll get key from that website)
http://api.ipinfodb.com/v3/ip-city/?key=&ip=180.234.12.237
Its has some response format that is xml, json, raw, just you have to pass a get variable &format=json
if (getenv(HTTP_X_FORWARDED_FOR)){ $pipaddress = getenv(HTTP_X_FORWARDED_FOR); $ipaddress = getenv(REMOTE_ADDR); //echo "Your Proxy IPaddress is : ".$pipaddress. "(via $ipaddress)" ; } else { $ipaddress = getenv(REMOTE_ADDR); //echo "Your IP address is : $ipaddress"; } $_API = "83838s88s4e0a65jhk80246d77d8s5s3988d9fb1asdkf000asd8fslasdlfasdf6s9sce"; $_URL = "http://api.ipinfodb.com/v3/ip-country/?key=$_API&ip=$ipaddress&format=json"; $data = file_get_contents($_URL); $data = json_decode($data); if(isset($data->statusCode) && $data->statusCode == "OK"){ if(isset($data->countryCode) && ($data->countryCode != "USA" )) || $data->countryCode != "BD")){ header("Location:http://www.yourdomain.com/geolocation.php"); exit; } }
In this way we can find out the country, city, post code, time zone etc. we can block or trace visitors in our website.
Montreal movers will impress you with their courteous and knowledgeable professionals, not to
mention their smooth and personalized service. s explanation of costs, if
he or she is overly aggressive, or if your gut says you.
Tip: When getting bids, ask about any surcharges, including fees for reassembling and disassembling.