Location: PHPKode > projects > SiteSpeed > sitespeed/Save.php
<?php
/*
                               SiteSpeed v2.4
                           (c) 2003 J.C. Kessels
                           http://www.numion.com/
*/
error_reporting(0);
$Icon = 'Icon3.gif';
$Time = $HTTP_GET_VARS['Time'];
$Name = $HTTP_GET_VARS['Name'];
if ($Name == '') $Name = 'default';


/* Append the measurement to the logfile. It will be analysed later
   by another program. This method was chosen to make this program as
   lightweight and fast as possible. */
if (($Time != '') &&
    ($Time > 0) &&
    ($Time < 60000) &&
    (($_SERVER["HTTP_REFERER"] == '') ||
     ($_SERVER["HTTP_HOST"] == '') ||
     (strstr($_SERVER["HTTP_REFERER"],$_SERVER["HTTP_HOST"]) != FALSE))) {
  $fd = fopen('Logs/' . base64_encode($Name) . '.log',"a+");
  if ($fd == FALSE) {
    if (mkdir("Logs",0700) == TRUE) {
      $fd = fopen('Logs/' . base64_encode($Name) . '.log',"a+");
      }
    }
  if ($fd != FALSE) {
    fwrite($fd,time() . ' ' . $Time . ' ' . $_SERVER['REMOTE_ADDR'] . "\r\n");
    fclose($fd);
    $Icon = 'Icon2.gif';
    }
  }

/* Return a 'location' header to the user, pointing to the animated
   icon. It would be slightly faster if we returned the content of
   the image here (for example by hard-coding the content into this
   program), but the difference is small, has no effect on the
   measurement, and it allows the user's browser to cache the image. */
$ScriptName = $_SERVER['SCRIPT_NAME'];
if (strrpos($ScriptName,'/') == FALSE) {
    $Codebase = '/';
  } else {
    $Codebase = substr($ScriptName,0,strrpos($ScriptName,'/')+1);
    }
header('location: http://' . $_SERVER['SERVER_NAME'] . $Codebase . $Icon);
?>
Return current item: SiteSpeed