Mail Log Script
Author: Stuart Millington Publishing date: 20.11.2002 20:31
This is a really simple script which will e-mail you logs of who is accessing your site. It does not require images to be loaded or J(ava)Script to be enabled on the users browser. All the processing is done server-side, so you will even see when a search engine accesses your site.
The script can be configured to send 1 e-mail for each access or to batch them up, e.g. send e-mail when there are 10 log records in the file.
The results, which will be e-mailed, look something like this:
Time: 2001-03-18 10:15
Referer: http://www.z-add.co.uk/index.php3
IP: 10.0.0.1, Host: theuser.co.uk
With: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Page: /yourpage.php3
This script is not meant to replace server logs. However, it is suitable for people who need a quick and simple record of their site's usage without a full analysis of the server's logs.
Note: Your website must have PHP enabled for this script to run.
To use the script:
1) Download the script!
2) Create a directory in your webspace to hold the logfile. CHMOD the directory permissions to 777 (ugo+rwx).
3) Configure the script with your e-mail addresses, and logfile location.
4) Upload the script to your webspace.
5) Include the script in any pages you wish it to monitor - with a PHP "include()".
Note 1: Ideally the log directory/file would be outside of your web space directories since it requires world writeable permissions. However, if your ISP does not allow this, there is nothing really secret in there so don't worry too much.
Note 2: The script has been written to deliberately ignore errors. It will deliberately loose log records rather than delay the loading of the page. There is no point having perfect log records and no visitors because of slow loading pages!!!
The zip file below includes the script and a blank(ish) index page to test it with.
Attached files
maillog.zip maillog.zip (The script and a blank(ish) index page to test it with.)
The copyright of some of the images that are used on this site is held by 3rd parties. The images are used for review purposes under the Fair Use / Fair Dealing provisions of copyright law. If any copyright holder objects to such use, please use the contact address below.

