Update farp.php

This commit is contained in:
awesomeuser 2023-08-04 16:18:44 +00:00
parent 67f13ba616
commit 6adacf933f

View file

@ -8,7 +8,7 @@
<?php <?php
// write new post to file only if necessary // write new post to file only if necessary
if (!is_null($_POST["image-bits"]) && strlen($_POST["image-bits"]) != 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 read file!");
$content = fread($myfile, filesize("posts.txt")); $content = fread($myfile, filesize("posts.txt"));
fclose($myfile); fclose($myfile);
@ -20,7 +20,7 @@
$content = $signature . "<br>UTC " . date("Y/m/d H:i") . "<br>" . htmlspecialchars($_POST["image-bits"]) . "<br>" . $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 write file!");
fwrite($myfile, $content); fwrite($myfile, $content);
fclose($myfile); fclose($myfile);
} else { } else {