PHP Classes

PHP User Step Logs: Record the pages a user accesses in a database

Recommend this page to a friend!
  Info   View files Example   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 190 This week: 1All time: 8,588 This week: 560Up
Version License PHP version Categories
user-step-logs 1.0GNU General Publi...5HTTP, PHP 5, User Management, Logging
Description 

Author

This class can record the pages a user accesses in a database.

It can take the identifier of a the current user, probably already logged in or the respective session identifier, and stores a record in a database table along with other details of the current user access.

The class stores the current request page URI, the URL of the previous page from the referrer header when present, the request query string, request parameters for POST requests, and the current date and time.

An auxiliary class accesses the configured database using PDO.

Picture of Ettore Moretti
  Performance   Level  
Name: Ettore Moretti is available for providing paid consulting. Contact Ettore Moretti .
Classes: 12 packages by
Country: Italy Italy
Age: ???
All time rank: 107741 in Italy Italy
Week rank: 411 Up18 in Italy Italy Up
Innovation award
Innovation award
Nominee: 3x

Example

<?php

/**
 * Add this code at the beginning of each page you want to check
 */

require_once 'core/UserStepLogs.class.php';

//Use your strategy to identify the user, register UID or IP or you believe anything useful to your interest
$UserId="XYZ0123";

$USL = new UserStepLogs($UserId,$_SERVER, $_POST);
   
/**
 * Add this code at the beginning of each page you want to check
 */


  Files folder image Files  
File Role Description
Files folder imagecore (3 files)
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file table_export.sql Data Auxiliary data

  Files folder image Files  /  core  
File Role Description
  Plain text file Database.class.php Class Class source
  Plain text file UserStepLogs.class.php Class Class source
  Accessible without login Plain text file UserStepLogs.config.php Conf. Configuration script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:190
This week:1
All time:8,588
This week:560Up