Skip to content

mrzeeshanplus/online-visitors-counter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Online Visitors Counter

Real-time online visitors counter using Ajax, PHP PDO and SQLite.

It adds a discrete link (auto-refreshed every 15 seconds) with the number of current users on the website.

If the link is clicked, a list of pages currently been visited appears, along with the number of visitors in each page.

Usage

Download and unzip this package.

Then upload the folder ovc to your website (anywhere).

Now you just need to call it:

<script src='path/to/ovc/counter.js'></script>

Example

The index.html of this package is the best example you can find. You'll understand when you run it. (Remember it needs to be run on a PHP server).

But here is another quick example: Let's say your website is http://example.com and you've uploaded the ovc folder to the root directory, you would call the script like this:

<script src='http://example.com/ovc/counter.js'></script>

Customizing

On the config.php file, you'll find a lot of customizable parameters. Easy to set, as you can see on the following example.

If you want the link to show "X Online", you'd set:

$visitorSingular = "Online";
$visitorPlural = "Online";
$linkFormat = '%1$d %2$s';

And the result would be:

License

The MIT License (MIT)

About

Real-time online visitors counter using Ajax, PHP PDO and SQLite.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 50.9%
  • JavaScript 47.6%
  • HTML 1.5%