<?php
$p = '';
$f = 'd.php';
$t = array(
'%x',
'<h1>%1$s</h1><em>%2$s</em><p>%3$s</p>',
'<form action="" method="post"><input type="text" name="n[h]"><textarea name="n[c]"></textarea><input type="submit"></form>',
'<!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"></head><body>%1$s</body></html>'
);
$c = '';
$d = is_array($d = @include $f) ? $d : array();
if ($p && @$_GET['p'] === $p){
if ($n = @$_POST['n']) {
$d[] = $n + array('d'=>time());
file_put_contents($f,'<?return '.var_export($d,1).';');
}
$c .= $t[2];
}
foreach (array_reverse($d) as $i){
$c .= sprintf($t[1],$i['h'],strftime($t[0],$i['d']),$i['c']);
}
printf($t[3], $c);
?>