PHP Classes

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

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 190 All time: 8,593 This week: 673Up
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: 107541 in Italy Italy
Week rank: 216 Up14 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 (6)  
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 (6)  /  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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:190
This week:0
All time:8,593
This week:673Up