From 0c09aa40590ce557be9c90b25219bb8f50464234 Mon Sep 17 00:00:00 2001 From: awesomeuser Date: Tue, 1 Aug 2023 21:41:26 +0000 Subject: [PATCH] anon update --- index.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 5a0f3c9..bd9edb5 100644 --- a/index.php +++ b/index.php @@ -41,7 +41,13 @@ // write to file if (!is_null($_POST["body"]) && strlen($_POST["body"]) != 0) { $myfile = fopen("posts.txt", "a") or die("Unable to open file! (a)"); - fwrite($myfile, htmlspecialchars($_POST["signature"]) . ": " . htmlspecialchars($_POST["body"]) . "
"); + + if (strlen($_POST["signature"]) != 0) { + fwrite($myfile, htmlspecialchars($_POST["signature"]) . ": " . htmlspecialchars($_POST["body"]) . "
"); + } else { + fwrite($myfile, "anon: " . htmlspecialchars($_POST["body"]) . "
"); + } + fclose($myfile); }