Advertisement
Guest User

Input Geo Data Ip to Mysqli Data Base

a guest
Jan 20th, 2020
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.70 KB | None | 0 0
  1. Input Geo Data Ip to Mysqli Data Base
  2.  
  3. ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼
  4.  
  5. if ( 'You Need More' == TRUE || 'You Need More' == 1 )
  6. {
  7.  
  8. GOTO http://www.fl-y.com/ifyouneedmore
  9.  
  10. }
  11. endif
  12.  
  13. ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲
  14.  
  15. <?php
  16. echo ini_get("memory_limit")."\n";
  17. ini_set("memory_limit","256m");
  18. echo ini_get("memory_limit");
  19. $link = mysqli_connect("127.0.0.1", "root", "", "geoip");
  20. $link2 = mysqli_connect("127.0.0.1", "root", "", "geoip");
  21. set_time_limit(0);
  22. echo memory_get_usage();
  23. $query = mysqli_query($link, "select substring_index(ip_start,'.',1), substring_index(substring_index(ip_start,'.',2),'.',-1), substring_index(substring_index(ip_start,'.',-2),'.',1), substring_index(ip_start,'.',-1), substring_index(ip_end,'.',1), substring_index(substring_index(ip_end,'.',2),'.',-1), substring_index(substring_index(ip_end,'.',-2),'.',1), substring_index(ip_end,'.',-1), id from `dbip_edu`");
  24. $data = mysqli_fetch_row($query);
  25. do{
  26. $ip_start_1 = $data[0];
  27. $ip_start_2 = $data[1];
  28. $ip_start_3 = $data[2];
  29. $ip_start_4 = $data[3];
  30. $ip_end_1 = $data[4];
  31. $ip_end_2 = $data[5];
  32. $ip_end_3 = $data[6];
  33. $ip_end_4 = $data[7];
  34.     $start_total = ($ip_start_1 * 16777216) + ($ip_start_2 * 65536) + ($ip_start_3 * 256) + $ip_start_4;
  35.     $end_total = ($ip_end_1 * 16777216) + ($ip_end_2 * 65536) + ($ip_end_3 * 256) + $ip_end_4;
  36.     mysqli_query($link2, "update `dbip_edu` set rem_ip_start = '$start_total', rem_ip_end = '$end_total' where rem_ip_start is null and ipv6 = 0 and id = '$data[8]'");
  37. }while($data);
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement