Update index.php

This commit is contained in:
awesomeuser 2023-08-01 23:31:21 +00:00
parent e868d161df
commit 7afbe7115c

View file

@ -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"]) . "<br>"
. $construct;
} else {
$construct = "anon [UTC " . date("m/d/Y H:i") . "] " . htmlspecialchars($_POST["body"]) . "<br>"
. $construct;
$signature = htmlspecialchars($_POST["signature"]);
}
$construct = $signature . " [UTC " . date("m/d/Y H:i") . "] " . htmlspecialchars($_POST["body"]) . "<br>" . $construct;
// write back into the file
$myfile = fopen("posts.txt", "w") or die("Unable to open file!");