<?php // track_view.php - include this in your .shtml pages $page_url = $_SERVER['REQUEST_URI']; $pdo = new PDO('mysql:host=localhost;dbname=your_db', 'user', 'pass'); $stmt = $pdo->prepare("INSERT INTO page_views (page_url, view_time) VALUES (?, NOW())"); $stmt->execute([$page_url]); ?> To use in .shtml :

<!--#include virtual="/hot_frames.shtml" --> To avoid counting every request on high-traffic sites, cache the “hot” list for 5 minutes:

CREATE TABLE page_views ( id INT AUTO_INCREMENT PRIMARY KEY, page_url VARCHAR(255) NOT NULL, view_time DATETIME NOT NULL, INDEX (page_url), INDEX (view_time) ); Place this at the top of your .shtml page (if using PHP parsing) or in a view_tracker.php included via SSI.