PHP Classes
elePHPant
Icontem

File: checkMD5.php

Recommend this page to a friend!
  Classes of Unay Santisteban  >  PHP File Integrity Check  >  checkMD5.php  >  Download  
File: checkMD5.php
Role: Example script
Content type: text/plain
Description: Aux
Class: PHP File Integrity Check
Check if directory files change using MD5 hashes
Author: By
Last change: Update checkMD5.php
Date: 5 years ago
Size: 1,291 bytes
 

 

Contents

Class file image Download
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <title></title>
    </head>
    <body>
        <?php
       
include 'libraries/integrity.md5.class.php';
       
$integrity = new integrity('path/to/check/directory');
       
$files = $integrity->checkMD5Hashes('hash.md5');
       
?>
<h2>Modified Files</h2>
        <table>
            <thead>
                <tr>
                    <th>File</th>
                    <th>State</th>
                    <th>User ID</th>
                    <th>Group ID</th>
                    <th>Last Access</th>
                    <th>Last Modified</th>
                </tr>
            </thead>
            <tbody>
            <?php foreach($files as $file) { ?>
<tr>
                    <td><?php echo $file['filename']; ?></td>
                    <td><?php echo $file['stat']; ?></td>
                    <td><?php echo $file['uid']; ?></td>
                    <td><?php echo $file['gid']; ?></td>
                    <td><?php echo $file['lastAccess']; ?></td>
                    <td><?php echo $file['lastModification']; ?></td>
                </tr>
            <?php } ?>
</tbody>
        </table>
    </body>
</html>