#!/usr/local/bin/php // Change this to the fil you want to write to $HOME = "/home/projects/cortex/"; $logdir = "$HOME/public_html/logs/"; $username = "cortex"; // Creat logfile based on date (e.g. 2001-08.wwwlog ) $logfile = $logdir . date("Y-m") . ".wwwlog"; //Get remote variables $date = date("F j, Y, g:i a"); $user=""; if(isset($REMOTE_ADDR)) { $user=exec("/home/member/p/p/bin/w -n | grep " . escapeshellcmd($REMOTE_ADDR) . " | awk '{print \"\",$1}' |head -1"); } // Don't log if it's the person's own script if ($user != $username) { // Log stuff into a file $fp = fopen( $logfile,"a+"); fwrite ( $fp, $REMOTE_ADDR, 50); fwrite ( $fp, " -", 5); fwrite ( $fp, $user, 20); fwrite ( $fp, " - ", 5); fwrite ( $fp, $date, 50); fwrite ( $fp, " - ", 5); fwrite ( $fp, $DOCUMENT_URI, 5000); fwrite ( $fp, " - ", 5); fwrite ( $fp, $HTTP_REFERER, 5000); fwrite ( $fp, " - ", 5); fwrite ( $fp, $HTTP_USER_AGENT, 5000); fwrite ( $fp, "\n", 5); fclose( $fp ); } ?>
The Cortex ProjectIdeas to Share |
|||
home : about : experiments : feedback | |||
Experiments: » Flash Version Checker - 16.01.02 » Snow - 23.11.01 » Marsh - 21.11.01 » Dots - 21.11.01 » Lights - 20.11.01 » Folding - 20.11.01
|
|||
This site requires the Flash 5 plug-in. The animation on the Home page shows the version of the plug-in installed on your computer. If you cannot see the animation, or if the version shown is lower than 5, then you should download the plug-in now. |