Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

Script that checks for geolocation IP and useragent

It checks for geolocation and if it's location A, it'll redirect to the prefered link.

Basically a cloaker in php

I'd highly appreciate it if someone could share such script or assemble one if you've got the time for it
Here's a couple libraries that should do what you want:

http://geocoder-php.org/
https://github.com/geocoder-php/Geocoder

:)
Willing to help. Message me if you have any questions. That should start you off very well.
You can download a free database and Php example here:
https://db-ip.com/db/#downloads

For user-agent you could use:
Code
$_SERVER['HTTP_USER_AGENT']

Maybe it's a good idea to use a cookie to buffer the database request


i think it's a interesting assignment and this is the way i solved it:

1. download the geoip database from:
https://db-ip.com/db/download/country

2. seperate the us ipv4 address range and the us ipv6 address range with python:


3. then check the ip location with this php script:
(Jun 15, 2018 06:28 PM)Have Faith Wrote:  Here's a couple libraries that should do what you want:

http://geocoder-php.org/
https://github.com/geocoder-php/Geocoder

:)
Willing to help. Message me if you have any questions. That should start you off very well.

(Jun 15, 2018 10:40 PM).kr. Wrote:  You can download a free database and Php example here:
https://db-ip.com/db/#downloads

For user-agent you could use:
Code
$_SERVER['HTTP_USER_AGENT']

Maybe it's a good idea to use a cookie to buffer the database request


i think it's a interesting assignment and this is the way i solved it:

1. download the geoip database from:
https://db-ip.com/db/download/country

2. seperate the us ipv4 address range and the us ipv6 address range with python:


3. then check the ip location with this php script:

Thanks, I appreciate it!


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Javascript]  by InvestorMay 14, 2022 01:30 PM 7 342 May 14, 2022 01:30 PM
Last Post: Nachfolger
[PHP] by T i e rMay 18, 2020 05:45 PM 0 95 May 18, 2020 05:45 PM
Last Post: T i e r
[Javascript]  by GanjaMar 23, 2018 03:04 PM 5 169 Mar 23, 2018 03:04 PM
Last Post: speckled_eggz