Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $log_dir = '/var/log/mikrotik';
- echo '<html><head><title>List of Log Files</title><link href="style.css" rel="stylesheet" type="text/css"></head>';
- // print the header
- echo '<table class="header"><tr class="header"><th class="header" align="left"><a class="header" href="./listfiles.php">';
- echo 'Mikrotik Router Log Viewer</a>';
- echo '</th><th class="header" align="right">';
- echo date("Y.m.d");
- echo '</th></tr></table>';
- echo '<body>';
- echo '<p><br></p>';
- $files = scandir($log_dir,0);
- if($files != FALSE){
- // no error ocured
- echo '<table class="listfiles"><tr><th class="listfiles">Log Files</th></tr>';
- foreach($files as $line){
- $ext = end(explode(".",$line));
- if($ext == "log"){
- echo '<tr class="listfiles"><td class="listfiles">';
- echo '<a class="listfiles" href="./showlog.php?logfile='.$line.'">'.$line.'</a>';
- echo '</td></tr>';
- }
- }
- echo '</table>';
- }
- echo '</body></html>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment