Update index.php

This commit is contained in:
awesomeuser 2023-08-01 21:15:19 +00:00
parent 04056f9184
commit dec65f62ad

View file

@ -39,12 +39,12 @@
<?php <?php
// write to file // write to file
$myfile = fopen("posts.txt", "a") or die("Unable to open file!"); $myfile = fopen("posts.txt", "a") or die("Unable to open file! (a)");
fwrite($myfile, $_POST["signature"] . ": " . $_POST["body"] . "<br>"); fwrite($myfile, $_POST["signature"] . ": " . $_POST["body"] . "<br>");
fclose($myfile); fclose($myfile);
// read from file // read from file
$myfile = fopen("posts.txt", "r") or die("Unable to open file!"); $myfile = fopen("posts.txt", "r") or die("Unable to open file! (r)");
echo fread($myfile,filesize("posts.txt")); echo fread($myfile,filesize("posts.txt"));
fclose($myfile); fclose($myfile);
?> ?>