5aa0bc7890
I guess I also haven't made a commit since doing a couple normal changes. huh
38 lines
1 KiB
PHP
38 lines
1 KiB
PHP
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
<title>/log/txt</title>
|
|
<link href="../style.css" rel="stylesheet" type="text/css" media="all">
|
|
<style>
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<nav><a href="../"><<<</a></nav>
|
|
<p>$ pwd</p>
|
|
<h1 class="title">/log/txt</h1>
|
|
<p>$ cat sys.log</p>
|
|
<section class="dir">
|
|
<?php
|
|
$infile = fopen("sys.log", "r") or die("file read error -_-");
|
|
$content = fread($infile,filesize("sys.log"));
|
|
fclose($infile);
|
|
$post_arr = explode("\n",$content);
|
|
$posts_out = "";
|
|
foreach($post_arr as $p) {
|
|
if(strlen($p) > 3) {
|
|
$date = substr($p, 0, strpos($p, " "));
|
|
$hdate = date("Y-m-d H:i:s", $date);
|
|
$pcont = substr($p, strpos($p, " ") + 1);
|
|
$posts_out = "<article>$hdate >> $pcont</article>$posts_out";
|
|
}
|
|
}
|
|
echo $posts_out;
|
|
?>
|
|
</section>
|
|
<p>$</p>
|
|
</body>
|
|
|
|
</html>
|