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
Old 10-22-2008, 06:39 PM Who's Online
Red_X_'s Avatar
Extreme Talker

Posts: 158
Location: Houston
Trades: 0
What would the best way to create a who's online script?

And could I get a code example I would appreciate it.

Thanks,

X
__________________
"Good News Everyone, by reading this your hearing my voice."
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
 
Register now for full access!
Old 10-22-2008, 07:36 PM Re: Who's Online
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I assume this is going to have to be based on registered users. If so, this is pretty much going to have to be a custom script every time. However, I found a quick tutorial for you that may help you get started: http://www.phpit.net/article/creatin...ne-script-php/
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 10-23-2008, 04:26 AM Re: Who's Online
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
This does not have to be based only on registered users if you only need a number.

You must already understand that there is no such term as "user is online" in respect of HTTP protocol, there is only the term "user made the request not more than N seconds ago". On first request from a user you set a cookie for a period of time which you consider to be the period of being "online", e.g. 5 minutes. On next requests you refresh that cookie to last for more 5 minutes and save that request information to some storage like DB or file. To display stats you need to obtain the number of unique user identificators which were used not more than 5 minutes ago.
__________________

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 10-23-2008, 08:16 AM Re: Who's Online
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Quote:
This does not have to be based only on registered users if you only need a number.
True, though I was thinking more along the lines of the "who's online" that is right here on Webmaster-Talk, at the bottom of the page...

@Red X: Perhaps you'd like to clarify?
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 10-23-2008, 08:37 AM Re: Who's Online
Novice Talker

Posts: 8
Name: qammar feroz
Location: Pakistan
Trades: 0
Quote:
Originally Posted by mtishetsky View Post
This does not have to be based only on registered users if you only need a number.

You must already understand that there is no such term as "user is online" in respect of HTTP protocol, there is only the term "user made the request not more than N seconds ago". On first request from a user you set a cookie for a period of time which you consider to be the period of being "online", e.g. 5 minutes. On next requests you refresh that cookie to last for more 5 minutes and save that request information to some storage like DB or file. To display stats you need to obtain the number of unique user identificators which were used not more than 5 minutes ago.
well, mtishetsky answer very accuratelly.
to display exact stat we must also store the IP address of the users. that will help us to identify unique users.

what do you think ?
__________________
No # 1 FREE Domain Name Low Cast High Quality Web Site Development and Web Hosting
Click Here

Please login or register to view this content. Registration is FREE
qammar is offline
Reply With Quote
View Public Profile Visit qammar's homepage!
 
Old 10-23-2008, 03:36 PM Re: Who's Online
Red_X_'s Avatar
Extreme Talker

Posts: 158
Location: Houston
Trades: 0
Quote:
Originally Posted by wayfarer07 View Post
True, though I was thinking more along the lines of the "who's online" that is right here on Webmaster-Talk, at the bottom of the page...

@Red X: Perhaps you'd like to clarify?
The script that you gave works, with some very simple editing. I got it to work with registered users.
__________________
"Good News Everyone, by reading this your hearing my voice."
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
Old 10-23-2008, 03:39 PM Re: Who's Online
teampower's Avatar
Super Talker

Latest Blog Post:
How to set up Google Analytics
Posts: 120
Name: G
Location: Hello-seo.blogspot.com
Trades: 0
link not working

Quote:
Originally Posted by wayfarer07 View Post
I assume this is going to have to be based on registered users. If so, this is pretty much going to have to be a custom script every time. However, I found a quick tutorial for you that may help you get started: http://www.phpit.net/article/creatin...ne-script-php/
__________________

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
:
Please login or register to view this content. Registration is FREE
teampower is offline
Reply With Quote
View Public Profile Visit teampower's homepage!
 
Old 10-23-2008, 03:42 PM Re: Who's Online
Red_X_'s Avatar
Extreme Talker

Posts: 158
Location: Houston
Trades: 0
Quote:
Originally Posted by teampower View Post
link not working
Check back every couple hours. Its a connection issue(wordpress)
__________________
"Good News Everyone, by reading this your hearing my voice."
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
Old 10-23-2008, 04:16 PM Re: Who's Online
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I swear it was working when I posted it
Quote:
Originally Posted by Red_X_ View Post
The script that you gave works, with some very simple editing. I got it to work with registered users.
That's great!
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.

Last edited by wayfarer07; 10-23-2008 at 04:18 PM..
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 10-23-2008, 04:23 PM Re: Who's Online
Skilled Talker

Posts: 50
Name: Marius
Trades: 0
You can only create a script that count the visitors that went on your site on the last minutes. You can't see all of them if they are actually online. Only with woopra you can
__________________

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
::
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

mariuskl is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Who's Online
 

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.30867 seconds with 12 queries