Php代码似乎运行了两次

Can any any one help with the following code it runs and works fine but seems to always log a double entry each time for a single hint.

Not sure if its the host or my code

Time: 23rd February 2012 5:45:36 am
IP Address: xxx.xxx.141.162
Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1Time: 23rd February 2012 5:45:36 am
IP Address: xxx.xxx.141.162
Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1

.

<?php   


    // Create a new image instance
    $im = imagecreatetruecolor(60, 20);

    // Make the background red
    imagefilledrectangle($im, 0, 0, 60, 20, 0xFF0000);

    // Draw a text string on the image
    imagestring($im, 3, 1, 1, 'Tracking', 0xCCFFFF);

    // Output the image to browser
    header('Content-Type: image/gif');

    imagegif($im);
    imagedestroy($im);



    // Get server variables 
$address = $_SERVER['REMOTE_ADDR'];
$referer = isset($_SERVER['HTTP_REFERER']) ? 
            $_SERVER['HTTP_REFERER'] : '';
$browser = $_SERVER['HTTP_USER_AGENT'];

    //Open log file
$file = fopen("log.html",'a');


//Set time zone and date format
date_default_timezone_set('Australia/Sydney');
$accessTime = date("jS F Y g:i:s a");



    //write collected data to file
fwrite($file, "<b>Time:</b> $accessTime<br />");

if( $address != null) 
    fwrite($file,"<b>IP Address:</b> $address<br />");

if($referer != null) 
    fwrite($file,"<b>Referer:<b> $referer<br />");

fwrite($file,"<b>Browser:</b> $browser<hr>");


    // save file and close
fclose($file);


?>

I think this may be because of request to favicon.ico. Browser does request to http://your-site.com/favicon.ico and webserver rewrite this request to your script that log it to file. So you get two lines in log file.