Php code seems to run twice
<p>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.</p>

<p>Not sure if its the host or my code</p>

<pre><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
</code></pre>

<p>.</p>

<pre><code>&lt;?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, "&lt;b&gt;Time:&lt;/b&gt; $accessTime&lt;br /&gt;");

if( $address != null) 
    fwrite($file,"&lt;b&gt;IP Address:&lt;/b&gt; $address&lt;br /&gt;");

if($referer != null) 
    fwrite($file,"&lt;b&gt;Referer:&lt;b&gt; $referer&lt;br /&gt;");

fwrite($file,"&lt;b&gt;Browser:&lt;/b&gt; $browser&lt;hr&gt;");


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


?&gt;
</code></pre>
