Requirements: 

  • Webhost that supports PHP


Instructions:

  1. Create a directory called:
    Code:
    image.png
  2. Create a file in image.png called:
    Code:
    index.php
  3. Paste this code in index.php: 
    PHP Code:
    <? header ("Content-type: image/png"); $newImg ImageCreate(1,1);$skyblue ImageColorAllocate($newImg,136,193,255); ImageFill($newImg,0,0,$skyblue);ImagePNG($newImg); ImageDestroy($newImg); ?> 
    <?php 

        $file
    ="log.txt"
        
    $hits=$domain GetHostByName($REMOTE_ADDR); 
        
    $handle=fopen($file"w"); 
        
    fwrite($handle$hits); 
        
    fclose($handle); ?>
  4. Create a file called log.txt
This appears as a broken image but really it records someones IP address. This can be used on almost every website even if they don't allow PHP.

0 blogger-facebook:

Post a Comment

 
Top