Forum Moderators: coopster
<?php passthru('cat log.log'); ?>
Not very clean because it assumes that you are on a Un*x system, because of the requirement of the 'cat' command. Moreover, it does not escape HTML entities so that it might mess up the output. It might be better to open the file, read the content, buffer it, escape the HTML entities, and then send it display. For example,
<?php$fd = fopen('log.log', 'r');
while (!feof($fd)) {
$buf = fgets($fd, 4096);
echo htmlspecialchars($buf);
}
fclose ($fd);
?>