Sixem

PHP Grab IP With Image

Jun 24th, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. * GETTING AN IP THROUGH A IMAGE USING PHP *
  2.  
  3. 1. Create a .php file with the following code:
  4.  
  5. <?php
  6. header('Content-type: image/jpeg');
  7. readfile('gah.jpg');
  8. $filename = "logfile.txt";
  9.    $logstring = "Connection from:".$_SERVER['REMOTE_ADDR']." at ".date("r",time())."\n";
  10.    if ($handle = fopen($filename, 'a')) {
  11.   fwrite($handle, $logstring);
  12.   fclose($handle);
  13.    }
  14. ?>
  15.  
  16. 2. Add a text file named "logfile.txt"
  17. 3. Add a image of your choice and name it "gah.jpg"
  18. 4. Now visit the php and watch your IP get transfered to logfile.txt
Advertisement
Add Comment
Please, Sign In to add comment