I have some code for a type of note making thing:
<h1>Notes About the rebellion:</h1>
<form action="index.php" method='post'>
Subject:<br><textarea name='textblock'></textarea><br>
Note:<br><textarea name='textblock2'></textarea><br>
<input type='submit' value='Add text'>
</form>
<iframe src="text.txt"></iframe>
<?php
// Open the text file
$f = fopen("text.txt", "a");
// Write text
fwrite($f, $_POST["textblock"] . ":" . PHP_EOL);
fwrite($f, $_POST["textblock2"] . PHP_EOL . "\r\n");
//fwrite($f, $_POST["textblock"] . "\r\n");
// Close the text file
fclose($f);
// Open file for reading, and read the line
$f = fopen("text.txt", "r");
// Read text
echo fgets($f);
fclose($f);
?>
Basically, I want when I type "/clear" in the second html
form input, and submit it, the text file "text.txt" will be either deleted or cleared.