cleansedbb
Technical User
I've got the following and it lets me view the file test.log and whatever I type gets appended to the bottom. what I want to be able to do is also remove from the file.
the files contents are:
test
1.1.1.1
hello
blah
blah blah blah
I want to say remove hello. it will be random. the text shows up in a textarea so you can type/delete but on submit it doesnt write anything but the new stuff to the bottom of the file.
CODE:
<?
if (! ($submit))
{
?>
<html>
<body>
<form action="./test.php" method=post>
<textarea name=list cols=45 rows=15><?php include "./test.log"; ?></textarea>
<input type="submit" value="Submit">
<?
}
else
{
$write = $list;
$fp = fopen("visitor.log","a"
;
fwrite($fp,$write);
fclose($fp);
}
?>
</form>
</body>
</html>
the files contents are:
test
1.1.1.1
hello
blah
blah blah blah
I want to say remove hello. it will be random. the text shows up in a textarea so you can type/delete but on submit it doesnt write anything but the new stuff to the bottom of the file.
CODE:
<?
if (! ($submit))
{
?>
<html>
<body>
<form action="./test.php" method=post>
<textarea name=list cols=45 rows=15><?php include "./test.log"; ?></textarea>
<input type="submit" value="Submit">
<?
}
else
{
$write = $list;
$fp = fopen("visitor.log","a"

fwrite($fp,$write);
fclose($fp);
}
?>
</form>
</body>
</html>