PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Tyler Heshka   PHP Visitor Tracking   README.md   Download  
File: README.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: PHP Visitor Tracking
Track visitor location and details using MySQLi
Author: By
Last change: update license badge
Update README.md for v.1.2.1
Date: 8 years ago
Size: 2,903 bytes
 

Contents

Class file image Download

visitorTracking

GitHub License Software Version Github Downloads

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.

Download

Old Versions

Documentation

http://tyrexi.us/visitorTrackingDocumentation

Demo

http://tyrexi.us/visitorTracking

Install

  1. Upload the files to your server.
  2. Edit the database configuration ( `src/_installation/db.php` )
  3. Create the `visitors` table in your database. (`src/_installation/visitors.sql` )
  4. Instance the class in your code.

Usage

//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.

License

This project is licensed under the MIT LICENSE

Contributors

Contributors on GitHub

Contributing

If you would like to help make this software better, please follow our guidelines found in CONTRIBUTING.md

Contact

  • Homepage: http://heshka.com
  • E-mail: tyler@heshka.com
  • KeyBase: https://keybase.io/theshka