/****************************************************************************************************************/ /* Description: This snippet is provide simple way to show user on how to lookup for a proxy record. */ /* suggestions for different city locations across the country. */ /* There are 1 steps in this snippet. For information, please visit IP2Location tutorial page at: */ /*https://www.ip2location.com/tutorials/how-to-lookup-for-proxy-record-using-php-and-mysql */ /****************************************************************************************************************/ /* You can obtain to setup the proxy database for IPv4 at: */ /* https://lite.ip2location.com/database/px4-ip-proxytype-country-region-city-isp */ connect_errno) { printf("Connect failed: %s\n", $mysqli->connect_error); exit(); } //Check if the IP address is a proxy address $ip_address = '4.0.0.37'; $result = $mysqli->query('SELECT * FROM ip2proxy_px4 WHERE inet_aton("' . $ip_address . '") between ip_from AND ip_to LIMIT 1'); if ($result->num_rows > 0){ //proxy $row = $result->fetch_assoc(); echo 'IP Address: ' . $ip_address . '
'; echo 'Proxy Type: ' . $row['proxy_type'] . '
'; echo 'Country Code: ' . $row['country_code'] . '
'; echo 'Country Name: ' . $row['country_name'] . '
'; echo 'Region Name: ' . $row['region_name'] . '
'; echo 'City Name: ' . $row['city_name'] . '
'; echo 'ISP: ' . $row['isp'] . '
'; } else{ //non-proxy echo $ip_address . ' is not a proxy
'; } ?>