Hello every one
is there any way that when my site loads these information comes that how much
Members: 47,077
Visitors Online: 1,392
Members Online: 10
Visits: 1,229,681
Members Online:
abc
def
ghi
ijk
lmn
opq
Like This.......
Waiting for hopefull response
SaQib
How Can I Add On My Site ?
Moderator: General Moderators
-
HiddenS3crets
- Forum Contributor
- Posts: 119
- Joined: Fri Apr 22, 2005 12:23 pm
- Location: USA
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Yes.
You need to store your member information in a database. Then you can see how many members you have very easily using
The hit counter can also be done with a database or very simply using a flat file (there's a recent snippet in our code snippets forum for the latter).
The visitors online... well that need to use a database where you update a timestamp for each user on each link click and then

These things can all individually be looked up on these forums pretty quickly by searching
You need to store your member information in a database. Then you can see how many members you have very easily using
Code: Select all
select count(*) from membersThe visitors online... well that need to use a database where you update a timestamp for each user on each link click and then
Code: Select all
$query = "select count(*) from user_activity where timestamp > ".(time()-(5*60));These things can all individually be looked up on these forums pretty quickly by searching
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
ok lets see. total members would not be hard. just
and that will give you total number of members.
the other "how many people are online" is a bit tricky. now if you want "guests" on the site and not "guests + members" that may be harder, but just doing the guests+members online (total number) would be discussed here
http://webmonkey.wired.com/webmonkey/04/50/index4a.html
members online, what i would do is have a seperate table where you store the username and the last time the user was visited any page, and MAYBE the page the user visited. then to find out how many users where online i would just select from that table where the last page hit time was 5 minutes or less than the current time. make sure you run a query on each page if the user is logged in to update the db with the new time that the user hit a site. to get the number of members just do a mysql_num_rows() then the members online just display the usernames from the table.
if you need more help, just post
EDIT: JESUS! EVERY TIME I GET BEAT!
Code: Select all
select count(*) as members from members_tablethe other "how many people are online" is a bit tricky. now if you want "guests" on the site and not "guests + members" that may be harder, but just doing the guests+members online (total number) would be discussed here
http://webmonkey.wired.com/webmonkey/04/50/index4a.html
members online, what i would do is have a seperate table where you store the username and the last time the user was visited any page, and MAYBE the page the user visited. then to find out how many users where online i would just select from that table where the last page hit time was 5 minutes or less than the current time. make sure you run a query on each page if the user is logged in to update the db with the new time that the user hit a site. to get the number of members just do a mysql_num_rows() then the members online just display the usernames from the table.
if you need more help, just post
EDIT: JESUS! EVERY TIME I GET BEAT!
Well, you should definitely check out the PHP Manual. It's a great start and even better reference.saqib389 wrote:well i m new in php.. so i m not getting all of urz point
if u ppl can refer me any good tutorials.. from where i can get that thing. so tat would b more clear for me.....
thnx in advance
Here's some good links from these forums:
viewtopic.php?t=29816
viewtopic.php?t=21400