diff --git a/index.php b/index.php index 1a54c08..bcf2c5d 100644 --- a/index.php +++ b/index.php @@ -77,28 +77,37 @@ " . $content; + $content = $signature . "
UTC " . date("m/d/Y H:i") . "
" . htmlspecialchars($_POST["body"]) . "
" . $content; // write string back into the file $myfile = fopen("posts.txt", "w") or die("Unable to open file!"); fwrite($myfile, $content); fclose($myfile); + + // update size with new change + $size = strlen($content); } - // show content - echo $content; + // read and show content + $myfile = fopen("posts.txt", "r") or die("Unable to open file!"); + while(!feof($myfile)) { + echo fgets($myfile) . "
"; + } + fclose($myfile); ?>