TechnGear.com

The Latest Technology and Gadget News



Keep Track Of How Many Users Are Online At Your Site

First things first, this script will display the number of users that are online at your website. You must include this script in every page that you want it to show up.

First off we need to create a new table in the db. So if you already have one that’s good.

CREATE TABLE useronline (
timestamp int(15) DEFAULT '0' NOT NULL,
ip varchar(40) NOT NULL,
page varchar(100) NOT NULL,
PRIMARY KEY (timestamp),
KEY ip (ip),
KEY page (page)
);

Insert that code into phpmyadmin or execute it yourself. What it does is adds a table called useronline with three fields. timestamp, ip and page.

To Read The Rest Click Here





Leave a Reply