I am having 3 problems with my site. I have been searching all day but haven't found anything easy or nice enough to put on my site. What I basically looking for is a way to track the users currently on my web site and a total of all the visits, but I don't want like an icon or something I just what a simple text and a number like the following:
Users Active:5
Total Visits: 100
Can anyone help?
Also I am wondering how I can add a login form my main page to login to my websites forum?
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
I use phpbb 3, but I figured out the login form so I don't need that anymore. I just need a way to track my total visits and users online and display them with a simple number in the home page.
Last edited by Jester2893; 08-19-2008 at 12:13 PM..
set ENABLE ONLINE USER LISTINGS: to YES in the admin panel
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
set ENABLE ONLINE USER LISTINGS: to YES in the admin panel
I want this for my website, not the forum. I want to know how many total visitors are online viewing my website and also the total amount that have viewed it .
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
First of all you should understand that there is no term "user online" considering http. There is a term "user who requested the page not more than X time units ago".
Then you setup some database table with name like "visits" with fields like "ip int(10)" and "added datetime" and on each page request do something like
PHP Code:
insert ignore into visits (ip, added) values
(ip2long($_SERVER['REMOTE_ADDR']), now())
and then
PHP Code:
select count(*) from visits where added > now() - 5 minutes
to get the number of hits during last 5 minutes and
PHP Code:
select count(*) from visits where to_days(added) = to_days(now())
Obviously this is very basic and this is pseudo code for you to get the general idea. Probably you will also would like to implement some checks for not counting duplicate IPs during one day, optimize the stuff and so on.
I said "insert ignore" because first I tried to describe the table in more details, generally there should be also an extra field like "day date" and an unique key on "ip" and "day" to prevent counting the same IP more than once in one day.
Also the table structure will strongly vary depending on what you want to consider a "user" - just an IP, or IP with User-Agent, or IP + Cookie or whatever else. Frankly speaking, counting visitors is one of the most complex tasks in modern internets, it is definitely not that easy as you may think from the first glance.