Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1. <?php
  2. $ipaddress = get_ip_address();
  3. if ($geoplugin = @json_decode( @file_get_contents('http://www.geoplugin.net/json.gp?ip='.$ipaddress),true )) {
  4. $country = $geoplugin['geoplugin_countryCode'];
  5. } elseif ( !empty(netipde($ipaddress)['country'])) {
  6. $country = netipde($ipaddress)['country'];
  7. } else {
  8. $country = 'US';
  9. }
  10.  
  11. /*
  12. *List Country ID = http://countryid.com/
  13. * example atau contoh below:
  14. *
  15. * $uri_affilate = 'http://facebook.com';
  16. */
  17. $title=$_GET['title'];
  18. $tmdb_id=$_GET['tmdbid'];
  19.  
  20. if ( $country == "US" ) {
  21. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3&data1='.$title;
  22. } elseif ( $country == "FR" ) {
  23. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3&data1='.$title;
  24. } elseif ( $country == "DE" ) {
  25. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3&data1='.$title;
  26. } elseif ( $country == "IT" ) {
  27. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3&data1='.$title;
  28. } elseif ( $country == "NO" ) {
  29. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3&data1='.$title;
  30. } elseif ( $country == "NL" ) {
  31. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3&data1='.$title;
  32. } elseif ( $country == "JP" ) {
  33. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3&data1='.$title;
  34. } elseif ( $country == "DK" ) {
  35. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3&data1='.$title;
  36. } elseif ( $country == "FI" ) {
  37. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3&data1='.$title;
  38. } elseif ( $country == "SE" ) {
  39. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3&data1='.$title;
  40. } elseif ( $country == "PT" ) {
  41. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3&data1='.$title;
  42. } elseif ( $country == "IN" ) {
  43. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3&data1='.$title;
  44. } elseif ( $country == "BR" ) {
  45. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3&data1='.$title;
  46. } elseif ( $country == "MX" ) {
  47. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3&data1='.$title;
  48. } else {
  49. $uri_affilate = 'https://www.ertchz.com/scripts/un981c6l?a_aid=a8314175&a_bid=270003a3';
  50. }
  51.  
  52. /*
  53. * Do not edit below
  54. */
  55. function get_ip_address(){
  56. foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key){
  57. if (array_key_exists($key, $_SERVER) === true){
  58. foreach (explode(',', $_SERVER[$key]) as $ip){
  59. $ip = trim($ip); // just to be safe
  60.  
  61. if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false){
  62. return $ip;
  63. }
  64. }
  65. }
  66. }
  67. }
  68. function netipde($ip) {
  69. $response=@file_get_contents('http://www.netip.de/search?query='.$ip);
  70. $patterns=array();
  71. $patterns["country"] = '#Country: (.*?)-.*?&nbsp;#i';
  72. $ipInfo=array();
  73. foreach ($patterns as $key => $pattern){
  74. $ipInfo[$key] = preg_match($pattern,$response,$value) && !empty($value[1]) ? $value[1] : 'not found';
  75. }
  76. return $ipInfo;
  77. }
  78. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement