Jackk

PHP IP Grabbing Script

Oct 15th, 2012
582
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. <?php
  2.  
  3. //Redirects the user so they never know they visited your site
  4. header( 'Location: http://www.google.co.uk' );
  5.  
  6. //Get the ip address of the user
  7. $ip=$_SERVER['REMOTE_ADDR'];
  8.  
  9. //Write the IP to a file
  10. $myFile = "ip.txt";
  11. $fh = fopen($myFile, 'a') or die("can't open file");
  12. $stringData = "$ip\n";
  13. fwrite($fh, $strintgDate);
  14. fclose($fh);
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment