https://github.com/felladrin/online-visitors-counter
Real-time online visitors counter using Ajax, PHP PDO and SQLite.
https://github.com/felladrin/online-visitors-counter
php php-pdo sqlite visitor-counter
Last synced: about 1 month ago
JSON representation
Real-time online visitors counter using Ajax, PHP PDO and SQLite.
- Host: GitHub
- URL: https://github.com/felladrin/online-visitors-counter
- Owner: felladrin
- License: mit
- Created: 2014-03-28T03:10:31.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-04-07T23:43:12.000Z (about 2 years ago)
- Last Synced: 2025-04-05T14:09:49.715Z (about 1 month ago)
- Topics: php, php-pdo, sqlite, visitor-counter
- Language: PHP
- Size: 22.5 KB
- Stars: 69
- Watchers: 6
- Forks: 24
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Online Visitors Counter
[](http://victor.mit-license.org/)
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.

## Requirements
- PHP5 (or later) with PDO SQLite extension
- SQLite
- Write permission on the folder 'ovc' so php can create and use the sqlite databaseIf you're not using a webhosting panel, like cPanel or VestaCP, please, install the above requirements manually on your OS.
## Usage
Download and unzip [this package](https://github.com/felladrin/online-visitors-counter/archive/master.zip).
Then upload the folder `ovc` to your website (anywhere).
Now you just need to call it:
```html
```
## 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:
```html
```
## 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:
```php
$visitorSingular = "Online";
$visitorPlural = "Online";
$linkFormat = '%1$d %2$s';
```And the result would be:
