| Sunday, September 05th, 2010 | Welcome Guest! - Register |
|
Sign In
Forget your password? Donations to date: $62.50 Support This Site Today! Latest Forum Posts |
Sale is OverThe sale in the download's section is now over.Posted by ~Ntsmarkv on Monday, August 31st, 2010 10:03 PM MST
PHP - Track Traffic
Tracking traffic is a huge deal to some website critics, being able to check one's web stats internally to see how many people visit each day, month, year, or overall. In this tutorial I'll explain and show you how you can accomplish this method and implement it to your own site. Step 1). Setting up database: You should have 3 tables in your database. hits: ------------------------------------------------------ CREATE TABLE `hits` ( `count_name` varchar(20) NOT NULL default '', `count` varchar(255) NOT NULL default '', `count_id` varchar(30) NOT NULL default '', PRIMARY KEY (`count_id`) ) TYPE=MyISAM; ------------------------------------------------------- public_hits: ----------------------------------------------------- CREATE TABLE `public_hits` ( `id` int(10) NOT NULL auto_increment, `unique` int(15) NOT NULL default '0', `total` int(15) NOT NULL default '0', `date` date NOT NULL default '0000-00-00', PRIMARY KEY (`id`) ) TYPE=MyISAM AUTO_INCREMENT=0 ; ----------------------------------------------------- daily_hits: ----------------------------------------------------- CREATE TABLE `daily_hits` ( `date` date NOT NULL default '0000-00-00', `unique_hits` int(255) NOT NULL default '0', `hits` int(255) NOT NULL default '0', PRIMARY KEY (`date`) ) TYPE=MyISAM; ------------------------------------------------------- Once you have set these up you then need to create a page to where you want this, such as footer.php. Step 2). Creating footer.php for stats: Footer.php Step 3). Creating your traffic.php for your stats to appear: Traffic.php This page has been accessed 1,638 times |
Articles Site Stats
Since July 23, 2005:
1,075,807 hits 783,208 unique visitors Today's Info: 230 hits 74 unique visitors More Traffic Stats Who's Online: Active Users: 0 Guests: 75 KASL Members: Currently 2,539 Newest member: Gilues Forum Stats: There are 9 categories There are 16 topics There are 67 posts Page Load Time Page loaded in 0.034 secs. |