Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Users Online, Total Visits, and Forum Login.
Old 08-18-2008, 11:24 PM Users Online, Total Visits, and Forum Login.
Novice Talker

Posts: 8
Name: Jesse
Trades: 0
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?


Sorry if this is not the right section.
Jester2893 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-19-2008, 04:16 AM Re: Users Online, Total Visits, and Forum Login.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And the forum code you are using is?
__________________
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?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-19-2008, 06:26 AM Re: Users Online, Total Visits, and Forum Login.
Super Talker

Posts: 104
Location: http://www.joomladevs.com
Trades: 0
Which Forum Script you are using? Please let us know
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


saurabhj is offline
Reply With Quote
View Public Profile Visit saurabhj's homepage!
 
Old 08-19-2008, 12:12 PM Re: Users Online, Total Visits, and Forum Login.
Novice Talker

Posts: 8
Name: Jesse
Trades: 0
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..
Jester2893 is offline
Reply With Quote
View Public Profile
 
Old 08-19-2008, 04:13 PM Re: Users Online, Total Visits, and Forum Login.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
phpbb3 already has this feature

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?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-19-2008, 10:04 PM Re: Users Online, Total Visits, and Forum Login.
Novice Talker

Posts: 8
Name: Jesse
Trades: 0
Quote:
Originally Posted by chrishirst View Post
phpbb3 already has this feature

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 .
Jester2893 is offline
Reply With Quote
View Public Profile
 
Old 08-20-2008, 04:02 AM Re: Users Online, Total Visits, and Forum Login.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
forums are also websites.

Moving this to PHP 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?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-20-2008, 06:15 AM Re: Users Online, Total Visits, and Forum Login.
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
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 (ipaddedvalues
(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.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 08-20-2008, 06:22 AM Re: Users Online, Total Visits, and Forum Login.
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to Users Online, Total Visits, and Forum Login.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29512 seconds with 12 queries