It is the simple counter with registration of visitings and
users agent - Internet Explorer(green),Netscape(blue) and Other(Red).
INSTALL:
1. Create the necessary tables. See below.
2. Create in MySql user counter,pass counter with access to these tables.
3. Save code in file count.php3
4. Add string <img src="http://your.host/count.php3"> where you want to put
the counter.
Note 1
array $exception contains ip-addresses from which visiting do not count.
Note 2
If you have one page with different names like
Id URL
4 http://www.some.com/
12 http://www.some.com/index.html
Choose Id from the table counter and change them in the table eq.
WAS: Id Id1
4 4
12 12
make: update eq set Id=4 where Id1=12;
Became:Id Id1
4 4
4 12
==== CREATE TABLE ========
Make this command in mysql
create database count;
use count;
create table agents (
Id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
agent VARCHAR(255) NOT NULL,
type ENUM("IE","Netscape","Other"),
counts INT NOT NULL DEFAULT 0,
last TIMESTAMP,
open TIMESTAMP,
KEY (Id),
INDEX (agent(64)),
UNIQUE (agent)
);
create table counters (
Id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
URL VARCHAR(255) NOT NULL,
counts INT UNSIGNED NOT NULL DEFAULT 0,
IE INT UNSIGNED NOT NULL DEFAULT 0,
Netscape INT UNSIGNED NOT NULL DEFAULT 0,
Other INT UNSIGNED NOT NULL DEFAULT 0,
last TIMESTAMP,
open TIMESTAMP,
KEY (Id),
INDEX (URL(64)),
UNIQUE (URL)
);
create table eq (
id SMALLINT,
id1 SMALLINT
);