473,486 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

find the number of users viewing a website at any point of time

34 New Member
Hi,
I am writing a code to display the number of user currently viewing my website at any point of time.
for example: for bytes i can see
network: 216355 as number of users currently viewing this website currently.

Also i want to know how can i get the IP address of machine from where the site is viewed or atleast user has logged in to my website. i want to keep track of this information.
Mar 14 '09 #1
4 4235
Markus
6,050 Recognized Expert Expert
There is no perfect way to tell how many people are viewing your site at any given time. I'm sure people will disagree, but w/e.

The best way to do this, is to log into your database the time of visit and the ip (available from $_SERVER['REMOTE_ADDR']). Then, when you want to display the current amount of visitors, query the database for the visits that are only a minute or 2 old. That way, it gives you a better answer.
Mar 14 '09 #2
rahullko05
34 New Member
thanks, this solves my problem
Mar 14 '09 #3
Markus
6,050 Recognized Expert Expert
@rahullko05
Glad I could help,

Markus.
Mar 14 '09 #4
abhighat4214
13 New Member
Yeah I agree , may be you can log the log in and log out time in database , execute the SQL count (*) function to keep track of number of users , but Yeah , I agree with the previous post, there is no perfect way to know how many people are using your site at a givne time.
Regards,
Abhijit
Mar 14 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

14
3864
by: NotGiven | last post by:
I am guessing I would hold a variable of when it's opened, then in the script that runs when the page is offloaded, I coudl calcualte it. How do you store a time variable? How do you calculate...
2
1956
by: Greg | last post by:
I have just started my first big project and I am having trouble predicting the system specs that will be required. At present during trials the site has around 15 users, although this will go to...
102
7269
by: me | last post by:
How do I prevent the save/print/email/mypictures toolbar from popping up when IE users place their cursor over photos at my website? Thank you in advance for your help. Signed, me
3
1302
by: Rod | last post by:
Today and tomorrow we're demonstrating our ASP.NET application to the external business customers who will be using it (this is what would best be called a B2B application). I've set things up so...
6
1954
by: google | last post by:
I have a few general questions. I am working on a new database to be used within my company. I would like to give a couple of people, particularly HR, the ability to add and delete Access users,...
2
2071
by: Don Hobson | last post by:
I am building a website and I want to allow users to do certain things without logging in. I would like to allow them to keep track of certain items, by adding them to a list. Like if they are...
6
2381
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am thinking about doing this since I got several cases that some of our internal users open more than one browser at the same time from our server. When one of the transactions was not...
10
1397
by: spacebebop | last post by:
#include <cstring> #include <iostream> using namespace std; class X { public: X(); X( char * ); ~X();
11
3274
by: AAaron123 | last post by:
I have an vs2008 app that generates a website. I have a vs2008 app that uses the webbrowser and does this: WebBrowser1.Navigate(New Uri(address)) the address is: ...
0
7175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7330
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5434
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4865
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3070
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.