test filewriting
This commit is contained in:
parent
04fa281867
commit
04056f9184
1 changed files with 6 additions and 3 deletions
|
@ -38,14 +38,17 @@
|
|||
<hr>
|
||||
|
||||
<?php
|
||||
// read and display file
|
||||
// write to file
|
||||
$myfile = fopen("posts.txt", "a") or die("Unable to open file!");
|
||||
fwrite($myfile, $_POST["signature"] . ": " . $_POST["body"] . "<br>");
|
||||
fclose($myfile);
|
||||
|
||||
// read from file
|
||||
$myfile = fopen("posts.txt", "r") or die("Unable to open file!");
|
||||
echo fread($myfile,filesize("posts.txt"));
|
||||
fclose($myfile);
|
||||
?>
|
||||
|
||||
<br>you: <?php echo $_POST["signature"]; ?>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
|
Reference in a new issue