image-bits

This commit is contained in:
awesomeuser 2023-08-04 15:41:40 +00:00
parent de3097f988
commit 2a7f0882f1

View file

@ -7,7 +7,7 @@
<?php <?php
// write new post to file only if necessary // write new post to file only if necessary
if (!is_null($_POST["body"]) && strlen($_POST["body"]) != 0) { if (!is_null($_POST["image-bits"]) && strlen($_POST["image-bits"]) != 0) {
$myfile = fopen("posts.txt", "r") or die("Unable to open file!"); $myfile = fopen("posts.txt", "r") or die("Unable to open file!");
$content = fread($myfile, filesize("posts.txt")); $content = fread($myfile, filesize("posts.txt"));
fclose($myfile); fclose($myfile);
@ -17,7 +17,7 @@
if (!is_null($_POST["signature"]) && strlen($_POST["signature"]) != 0) { if (!is_null($_POST["signature"]) && strlen($_POST["signature"]) != 0) {
$signature = htmlspecialchars($_POST["signature"]); $signature = htmlspecialchars($_POST["signature"]);
} }
$content = "<div class='post'><h2>" . $signature . "</h2><i>UTC " . date("Y/m/d H:i") . "</i><div>" . htmlspecialchars($_POST["body"]) . "</div></div>" . $content; $content = $signature . "<br>UTC " . date("Y/m/d H:i") . "<br>" . htmlspecialchars($_POST["image-bits"]) . "<br>" . $content;
// write string back into the file // write string back into the file
$myfile = fopen("posts.txt", "w") or die("Unable to open file!"); $myfile = fopen("posts.txt", "w") or die("Unable to open file!");