From 7afbe7115cc59aae4f13acb975c75643ef1d970f Mon Sep 17 00:00:00 2001 From: awesomeuser Date: Tue, 1 Aug 2023 23:31:21 +0000 Subject: [PATCH] Update index.php --- index.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index 94a0878..8d11db6 100644 --- a/index.php +++ b/index.php @@ -78,13 +78,11 @@ $construct = fread($myfile,filesize("posts.txt")); fclose($myfile); + $signature = "anonymous"; if (!is_null($_POST["signature"]) && strlen($_POST["signature"]) != 0) { - $construct = htmlspecialchars($_POST["signature"]) . " [UTC " . date("m/d/Y H:i") . "] " . htmlspecialchars($_POST["body"]) . "
" - . $construct; - } else { - $construct = "anon [UTC " . date("m/d/Y H:i") . "] " . htmlspecialchars($_POST["body"]) . "
" - . $construct; + $signature = htmlspecialchars($_POST["signature"]); } + $construct = $signature . " [UTC " . date("m/d/Y H:i") . "] " . htmlspecialchars($_POST["body"]) . "
" . $construct; // write back into the file $myfile = fopen("posts.txt", "w") or die("Unable to open file!");