From 1fb9a966dd3d6f80468e030b0cc7d6daa7148b56 Mon Sep 17 00:00:00 2001 From: awesomeuser Date: Wed, 2 Aug 2023 21:59:10 +0000 Subject: [PATCH] split off post behavior --- index.php | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/index.php b/index.php index 52fd7c6..5147550 100644 --- a/index.php +++ b/index.php @@ -77,7 +77,7 @@ -
+

furpsocial

@@ -108,34 +108,14 @@
refresh feed

" . $signature . "

UTC " . date("Y/m/d 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); - - $_POST = array(); - } + // // make sure the file, well, exists + // $myfile = fopen("posts.txt", "a"); + // fclose($myfile); // show content - echo $content; + $myfile = fopen("posts.txt", "r") or die("Unable to open file!"); + echo fread($myfile, filesize("posts.txt")); + fclose($myfile); ?>