About the Adojji Server ProjectWelcome, Internet user from IP address . I hope you like this tribute to the Apache web server. Hint: It helps if you know how Apache got it's name. 23 Apr 2005 - HEY! Those shameless revisionists changed the history! It used to say that it was the secondary reason; now, they're saying that it's incorrect. Dang!
# author: http://modzer0.cs.uaf.edu/~bishop # uses two files: pagehits.count and pagehits.ip # both need to be writable by the webserver $fd = fopen( "pagehits.count" , "r+" ); $count = (int) fread( $fd, filesize( "pagehits.count" ) ); fclose($fd); $fd = fopen( "pagehits.ip" , "r+" ); $lastIp = fread( $fd, filesize( "pagehits.ip" )); fclose($fd); # change $SERVER_ADDR to webadmin's IP to # ignore the hits by the maintainer of the webpage. if( $_SERVER["REMOTE_ADDR"] != $_SERVER["SERVER_ADDR"] ) if( $_SERVER["REMOTE_ADDR"] != $lastIp ) { $count++; $fd = fopen("pagehits.count" , "w+" ); fwrite( $fd, $count); fclose($fd); $fd = fopen("pagehits.ip" , "w+" ); fwrite( $fd, $_SERVER["REMOTE_ADDR"] ); fclose($fd); } #now do the fancy output. echo "Wow! Super-advanced ADP technology: Hit Counter: $count "; ?>
Problems? Comments? Please contact us.
© ChelseaData.ca