Foxy1986

get info

Jan 26th, 2018
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.23 KB | None | 0 0
  1. <html>
  2. <head>
  3. </head>
  4. <img src="http://imageurlhere" alt="fox image">
  5. </html>
  6.  
  7. <?php
  8.  
  9.  
  10. function getUserIP()
  11. {
  12.     $client  = @$_SERVER['HTTP_CLIENT_IP'];
  13.     $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
  14.     $remote  = $_SERVER['REMOTE_ADDR'];
  15.  
  16.     if(filter_var($client, FILTER_VALIDATE_IP))
  17.     {
  18.         $ip = $client;
  19.     }
  20.     elseif(filter_var($forward, FILTER_VALIDATE_IP))
  21.     {
  22.         $ip = $forward;
  23.     }
  24.     else
  25.     {
  26.         $ip = $remote;
  27.     }
  28.  
  29.     return $ip;
  30. }
  31.  
  32.  
  33. $ip = getUserIP();
  34.  
  35.  
  36.  
  37.  
  38.  
  39. $fullpath  = $_SERVER['REQUEST_URI'];
  40. $filename  = basename($fullpath);
  41. $useragent = $_SERVER["HTTP_USER_AGENT"];
  42.  
  43.  
  44. $file = 'ips.log';
  45.  
  46. file_put_contents($file, "_____________________________________________________________________", FILE_APPEND);
  47. file_put_contents($file, "\r\n", FILE_APPEND);
  48. file_put_contents($file, $fullpath, FILE_APPEND);
  49. file_put_contents($file, "\r\n", FILE_APPEND);
  50. file_put_contents($file, $ip, FILE_APPEND);
  51. file_put_contents($file, "\r\n", FILE_APPEND);
  52. file_put_contents($file, $useragent, FILE_APPEND);
  53. file_put_contents($file, "\r\n", FILE_APPEND);
  54. file_put_contents($file, "_____________________________________________________________________", FILE_APPEND);
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment