Jump to content

Current counter currently my page


Lola777

Recommended Posts

Hello ,

I am looking for a simple code to install which gives me the number of person in real time of person currently on the page.

I'm looking for a while but I find no functional code.

Thank you for your help

:)

Link to comment
Share on other sites

You want to know how many people are using a certain page at any given time?  YOu could do that by directing all of your requests thru a main script that then counts how many times a specific page/script is requested.  Problem with that is how do you propose to remove a count when the user closes the browser.  Do you want to know how many times a page is used within a certain time period perhaps?

This counter mechanism would have to use a db table since you can't store the numbers in a session var.

Link to comment
Share on other sites

Hello, I would like. that every 30 seconds the counters this refresh. the counter gives me the number of people currently on the html page. without having to identify with anything. just be present on the page. I would like the simplest possible code without having to interact with a database.

 

Link to comment
Share on other sites

And what do you want to do with this count?

Realistically, your count will never be more than 1 (unless you are being visited by a bot).

Very few sites have significant traffic without having been around for a long time, or having had a significant advertising and marketing budget or some other phenomenon that is attracting visitors and traffic.

The simplest way to see what is going on is also 100% free to you -- Google Analytics.  

Just hit Analytics for your site and click on Real time.

Link to comment
Share on other sites

Hello, I would like. that every 30 seconds the counters this refresh. the counter gives me the number of people currently on the html page. without having to identify with anything. just be present on the page. I would like the simplest possible code without having to interact with a database.

 

Link to comment
Share on other sites

Why are you repeating yourself?  You were given everything you asked for - just not the way you expected it.

 

What you are asking as I said previously is very complex.  You do realize that when a page is requested by an html request from a site visitor that starts a task which generates the page and sends it to that client and the task then goes away.  You yourself now have no way of knowing that that client ever made a visit to your site unless your task DID SOMETHING to register that visit.  That's a db usage which you don't seem to want to do.  And just how does "the counters this refresh" occur?  Do YOU run a script every 30 seconds to see what the counts are on YOUR client screen?  To me it sounds like a place for a cron job (look it up) that happens every 30 secs and saves the resulting counts along with a a datetime value in a db table where you can then review it at any time you want to and have a delete button to clear the old data out as you wish.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.