janter13

anu

Nov 29th, 2014
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  1. <?php
  2. include 'head.php';
  3. echo '<div class="acy apl abt abb" align="center">
  4. <span >
  5. <h1>USER ONLINE</h1>
  6. </span>
  7. </div>';
  8. $stat = file_get_contents('stats.txt');
  9. $data = explode("\n",$stat);
  10. foreach($data as $ol){
  11. $on = explode('|~~|',$ol);
  12. if($on[1]){
  13. $result = geoCheckIP($on[1]);
  14. $country = explode(' - ',$result[country]);
  15. echo '<left>
  16. <div class="aclb fcg fsl abb">
  17. <div class="acw apm">
  18. IP Address = '.$on[1].'<br>
  19. User Agent  = '.$on[2].'<br>Country = '.$country[1].' ('.$country[0].' )</div></div></left>';
  20. }
  21. }
  22. echo '<hr style="background-color:#cccccc;height:1px;border:0px solid #fff;margin:0.3em auto;width:100%;"/>
  23. <a class="fcs" href="http://jan-ter.com">&raquo; TUTUP &laquo;</a><br><br>';
  24. include 'bawah/foot.php';
  25.  
  26. function geoCheckIP($ip){
  27. if(!filter_var($ip,FILTER_VALIDATE_IP)){
  28. /* throw new InvalidArgumentException("IP is not valid"); */
  29. }
  30.  
  31. $response= file_get_contents('http://www.netip.de/search?query='.$ip);
  32. /* if(empty($response)){
  33. throw new InvalidArgumentException("Error contacting Geo-IP-Server");
  34. } */
  35.  
  36. $patterns=array();
  37. $patterns["domain"] = '#Domain:(.*?)&nbsp;#i';
  38. $patterns["country"] = '#Country:(.*?)&nbsp;#i';
  39. $patterns["state"] = '#State/Region:(.*?)<br#i';
  40. $patterns["town"] = '#City:(.*?)<br#i';
  41.  
  42. $ipInfo=array();
  43. foreach($patterns as $key => $pattern){
  44. $ipInfo[$key] = preg_match($pattern,$response,$value) && !empty($value[1]) ? $value[1] : 'not found';
  45. }
  46. return $ipInfo;
  47. }
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment