visitorTracking is a simple PHP class to gather visitor information, and store it in a database using MYSQLi. It's more modern and complete than others I have seen around on Google/HotScripts. (SQLi, oop(ish?), etc...) No bells or whistles, fully customizable.
http://tyrexi.us/visitorTrackingDocumentation
http://tyrexi.us/visitorTracking
-
Upload the files to your server.
-
Edit the database configuration (
src/_installation/db.php
) -
Create the
visitors
table in your database. (src/_installation/visitors.sql
) -
Instance the class in your code.
//define database
define( 'DB_HOST', 'localhost' ); // set database host
define( 'DB_USER', 'root' ); // set database user
define( 'DB_PASS', '' ); // set database password
define( 'DB_NAME', 'yourdatabasename' ); // set database name
//include the class
include( 'src/class.visitorTracking.php' );
//instance the class
$visitors = new visitorTracking();
The constructor method automatically calls the tracking method $visitors->track();
which inserts the collected data.
You print the array containing the current visit by echoing $visitors->displayThisVisit();
You can output a table containing all the paginated data from the database by echoing $visitors->displayVisitors();
Alternatively, you can just grab the table data from your database SELECT * FROM visitors ORDER BY date DESC
and format it according to your specifications.
This project is licensed under the MIT LICENSE
If you would like to help make this software better, please follow our guidelines found in CONTRIBUTING.md
- Homepage: http://heshka.com
- E-mail: [email protected]
- KeyBase: https://keybase.io/theshka