<?php
    $curIP 
"68.229.161.247";
    
$newIP $_SERVER['REMOTE_ADDR'];
    
// This should be this file
    
$filename "iptracker.php";
    if(
$_GET['set'] == && $curIP != $newIP)
    {
        
$handle fopen($filename"r");
        
// These throw away the first three lines
        
fgets($handle);
        
fgets($handle);
        
fgets($handle);
        
// Put the rest of the file into a buffer
      
while (!feof($handle))
      {
        
$buffer .= fgets($handle);
       }        
         
fclose($handle);
         
// Write it back
        
$handle fopen($filename'w+');
        
$buffer "
<?php
    \$curIP = \"$newIP\";
"
.$buffer;
        
fwrite($handle$buffer);
       
fclose($handle);
       print 
"Updated.";
    }
    else
    {
        print 
"Current IP: $curIP";
    }
?>