|
|
#1 (permalink) |
|
Member
|
This counter counts the number of unique visitors by logging the IP's.
It uses 2 function's: count() - Counts the user. visits() - Shows the number of visits I hope you know how to connect to a mysql database. But if you don't there is a tutorial somewhere that i can't link to.... due to some restriction's... The table structure is following: Code:
CREATE TABLE `counter` ( `ip` varchar(15) NOT NULL default '', `number` int(11) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; The code: PHP Code:
Now you can count a visitor by adding: PHP Code:
PHP Code:
Code:
Array
(
[unique] => 10
[total] => 37
)
Array
(
[unique] => 10
[total] => 38
)
We have had 3 unique visit's and a total of 10 visit's. You would use the code : PHP Code:
|
|
|
|
|
|
#2 (permalink) | |
|
I am not *****
Join Date: Aug 2006
Location: Pakistan
Posts: 370
|
Nice one
. And helpful too. Its a nice tutorial for Newbies.Quote:
. and heres the link to it:-http://www.betlik.com/showthread.php?t=17 BTW, where are the restrictions? |
|
|
|
|
|
|
#6 (permalink) |
|
Senior Member
Join Date: Nov 2006
Posts: 225
|
Hey army! first thanks for all the tutorials - i finished the first one, connecting to my MYsql successfully, yet now, when i try to make the new table in this tutorial i get this error:
SQL query: CREATE TABLE `counter` ( `ip` varchar( 15 ) NOT NULL default '', `number` int( 11 ) NOT NULL default '0' ) ENGINE = MYISAM DEFAULT CHARSET = latin1; MySQL said: Documentation #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ENGINE=MyISAM DEFAULT CHARSET=latin1' at line 4 Can you tell me what i did wrong?? thanks sooo much! roy77 |
|
|
|
|
|
#7 (permalink) | |
|
co-admin
Join Date: Oct 2006
Location: Belgium
Posts: 666
|
Quote:
Btw, this is Ghezus' tutorial .
|
|
|
|
|
|
|
#10 (permalink) | |
|
co-admin
Join Date: Oct 2006
Location: Belgium
Posts: 666
|
Quote:
It is not possible in simple HTML/JavaScript source .For an ASP counter, check here: http://www.betlik.com/script-asp-hit-counter-t1027.html |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Lord of the Rings saves TimeWarner | Brian Turner | Business Forum | 3 | 31-12-2007 03:43 PM |
| Choosing business software? | Brian Turner | Business Forum | 8 | 30-08-2004 10:48 AM |
| AdSense and spidering | Brian Turner | Search Engine Optimisation | 1 | 07-06-2004 05:35 PM |
| Past my driving test today | JamesSmith | General | 2 | 02-06-2004 04:51 PM |
| Exploding Whale hits Taiwan | Brian Turner | General | 1 | 31-01-2004 01:14 PM |