#!/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 | |||
|
About: The Cortex Project has been develeoped by Kevin Cannon and Paul May as an assignment for the Authoring for Multimedia module of DCU's B.Sc. in Multimedia. Cortex explores our own experiments in Flash, and provides source files to encourage others to improve on what we have started. If you have any comments or suggestions about the site, use the feedback page to get in touch. |