Advertisement
Guest User

Sub Creation - PHP

a guest
Oct 1st, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. <?php
  2. print_r($_REQUEST);
  3. ini_set('display_errors', 1);
  4. error_reporting(E_ALL);
  5.  
  6. function verifyInternalIP($ip) {
  7. if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) && !filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE)) {
  8. return true;
  9. }
  10. else {
  11. return false;
  12. }
  13. }
  14.  
  15.  
  16. $server = $_REQUEST['server'];
  17. $external = $_REQUEST['ext'];
  18. $domain = $_REQUEST['domain'];
  19.  
  20. $ips = explode(',', $server);
  21. $int_ip = $ips[0];
  22. $ext_ip = $ips[1];
  23. $iv6_ip = $ips[2];
  24.  
  25. if($int_ip == 'none' || $int_ip == '')){
  26. $les = false;
  27. }
  28. if($ext_ip == 'none' || $ext_ip == '')){
  29. die('External IP Does Not Exist');
  30. }
  31. if($iv6_ip == 'none' || $iv6_ip == ''){
  32. $ipv6 = false;
  33. }
  34.  
  35. //Check Internal IPv4
  36. if($les != 'false'){
  37. if (!verifyInternalIP($int_ip)) {
  38. echo 'Invalid Internal IP Provided';
  39. die();
  40. }
  41. }
  42.  
  43. //Check External IPv4 Valid
  44. if($ext_ip != 'false'){
  45. if (!verifyInternalIP($int_ip)) {
  46. echo 'Invalid Internal IP Provided';
  47. die();
  48. }
  49. }
  50. //Check External IPv6 Valid
  51. if($ipv6 != 'false'){
  52. if (!verifyInternalIP($int_ip)) {
  53. echo 'Invalid Internal IP Provided';
  54. die();
  55. }
  56. }
  57.  
  58. //Login to Rage4 Command
  59.  
  60. include('rage4.php');
  61. $r4 = new rage4('contact@evoburst.com', 'e07072d9220a3cfdaa7f71c805019669');
  62.  
  63. if($sub == '1'){ $dom = '37697'; }
  64. if($sub == '2'){ $dom = '37699'; }
  65. if($sub == '3'){ $dom = '37703'; }
  66. if($sub == '4'){ $dom = '37705'; }
  67.  
  68. //Check Geo Tag
  69. if($geo == 'yes'){
  70. //NC1 - IP1
  71. if($ext_ip == '192.111.152.114'){ $geo_long = '-81.538985'; $geo_lat = '35.914020'; }
  72. if($ext_ip == '192.111.152.115'){ $geo_long = '-81.538985'; $geo_lat = '35.914020'; }
  73. //LA1 - IP1
  74. if($ext_ip == '68.64.160.150'){ $geo_long = '-118.243685'; $geo_lat = '34.052234'; }
  75. //DE1 - IP1
  76. if($ext_ip == ''){ $geo_long = '6.773456'; $geo_lat = '51.227741'; }
  77. if($ext_ip == ''){ $geo_long = '6.773456'; $geo_lat = '51.227741'; }
  78. //LES - Netherlands
  79. if($ext_ip == '213.163.67.24'){ $geo_long = '4.477733'; $geo_lat = '51.924420'; }
  80. if($ext_ip == '213.163.67.49'){ $geo_long = '4.477733'; $geo_lat = '51.924420'; }
  81. //LES - Italy
  82. if($ext_ip == '95.141.35.139'){ $geo_long = '9.185924'; $geo_lat = '45.465422'; }
  83. if($ext_ip == '95.141.35.117'){ $geo_long = '9.185924'; $geo_lat = '45.465422'; }
  84. //LES - USA
  85. if($ext_ip == '162.251.114.75'){ $geo_long = '-96.800451'; $geo_lat = '32.780140'; }
  86. if($ext_ip == '162.251.114.76'){ $geo_long = '-96.800451'; $geo_lat = '32.780140'; }
  87. //LES - UK
  88. if($ext_ip == '149.255.100.108'){ $geo_long = '-1.617780'; $geo_lat = '54.978252'; }
  89. if($ext_ip == '149.255.100.119'){ $geo_long = '-1.617780'; $geo_lat = '54.978252'; }
  90. //LES - JP
  91. if($ext_ip == '108.61.200.70'){ $geo_long = '139.691706'; $geo_lat = '35.689487'; }
  92. //LES - AU
  93. if($ext_ip == '103.25.58.8'){ $geo_long = '151.206990'; $geo_lat = '-33.867487'; }
  94.  
  95. //Prepare Insert
  96.  
  97. $create = $r4->createProxy($dom, $domain, $ip_addr, $type, 800, $long, $lat);
  98. }
  99.  
  100. if($geo == 'no'){
  101. $create = $r4->createRecord($dom, $domain, $ip_addr, $type, '', 800);
  102. $res = str_replace('Record added with id ', '', $create);
  103.  
  104. }
  105.  
  106. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement