Morpheusweb.it - Risorse per webmaster: script, ASP.NET, C#, Visual Basic .Net, tutorial, asp, javascript, css, php, html, java, ADO, VBScript, forms, frames, Active Server Pages, Dynamic HTML, database, gratis per webmaster e webdesigner

Log File

A function that writes on a log file of many information about the visitors of a web site.



<a href="log.php">view log file</a><?
$xx1=$HTTP_SERVER_VARS['SERVER_PORT'];
$day = date("d",time()); $month = date("m",time()); $year = date("Y",time());
if ($REMOTE_HOST == "") $visitor_info = $REMOTE_ADDR;
else $visitor_info = $REMOTE_HOST;
$base = 'http://' . $HTTP_SERVER_VARS['SERVER_NAME'] . $PHP_SELF;
$x1=`host $REMOTE_ADDR|grep Name`;
$x2=$REMOTE_PORT;
$fp = fopen("log.php", "a");
$date=`date`;
fputs($fp, "$visitor_info -$HTTP_USER_AGENT- Date/Time: $date$REMOTE_ADDR:$x2 $x1$base:$xx1--------------------------------");fclose($fp);
?>


Download code...


Print this page


 

Inizio pagina

risorse per webmaster