Visitor Information
Overview
A visitor information script has been added to our server. This script is intended to provide information about each visitor to your page. The information consists of the date and time of the visit together with the URL of the visitor's server. This information is stored in a file in your user area. The information may be examined by simply displaying the file in your browser, by using a report generator or by using one of the specific post processing scripts.
Three post processing scripts are provided. The first displays day and month counts and month averages, the second displays counts for each visitor and the third displays counts for each country visiting your page.
To protect the server the visitor information file must have a special header.
Usage
First
download VisitorInfo.zip and unzip it using WinZip. This will provide you with the following nine files:
- VisitorInfo - the visitor information perl script.
- VisitorInfo-Averages - the post processing perl script for averages.
- VisitorInfo-Counts - the post processing perl script for counts.
- VisitorInfo-Countries - the post processing perl script for countries.
- VisitorInfo.html - a page which uses the script.
- VisitorReport.html - a page which uses a report generator to display selected reports.
- Visitors - an example of a visitor information file.
- Header - the visitor information file header.
- VisitorInfoDoc.html - this file.
The visitor information script is called by inserting
<IMG SRC="http://linuxenvy.com/cgi-bin/bprentice/VisitorInfo?user_name+visitor_info_file">
in your page. Where:
- user_name is your user name i.e. bprentice.
- visitor_info_file is the name and subdirectory of your visitor information file. i.e if your visitor information file is called Visitors and it is located in your public_html directory then visitor_info_file is simply Visitors but if it is located in your public_html/VisitorInfo directory then visitor_info_file is VisitorInfo/Visitors.
Read VisitorInfo.html to see an example.
Post Processing
A report generator
may be used to display selected information from the visitor information file. Read VisitorReport.html to see an example.
To use the averages post processing script add the line
<a href="http://linuxenvy.com/cgi-bin/bprentice/VisitorInfo-Averages?user_name+visitor_info_file"> Averages </a>
to your post processing page where user_name and visitor_info_file are described above.
To use the counts post processing script add the line
<a href="http://linuxenvy.com/cgi-bin/bprentice/VisitorInfo-Counts?user_name+visitor_info_file"> Counts </a>
to your post processing page where user_name and visitor_info_file are as above. This script
normally formats the output in a table. To improve performance of this script, an option is
available which does not use a table. This option is selected by adding "notable" as an
additional argument.
<a href="http://linuxenvy.com/cgi-bin/bprentice/VisitorInfo-Counts?user_name+visitor_info_file+notable"> Counts </a>
To use the countries post processing script add the line
<a href="http://linuxenvy.com/cgi-bin/bprentice/VisitorInfo-Countries?user_name+visitor_info_file"> Countries </a>
to your post processing page where again, user_name and visitor_info_file are as above.
An example of a visitor information post processing page is
here.
Installation
To add visitor information to your page do the following:
- Place a call to VisitorInfo in your page.
- Copy file Header to your user area and rename it to correspond to visitor_info_file in your VisitorInfo call.
- Add a post processing page.
- Test by displaying your pages.
Status
An example may be examined
here.
These scripts were written by Brian Prentice who may be contacted at bprentice@webenet.net.