i got the code to work by adding a line:
$text=$_POST["update"];
here is my code now:
<?php
$filename="blog2.txt";
if ($POST["update"] == "yes") {
$file = fopen($filename, "w");
$text=stripslashes($POST["text"]);
fputs($file, $text);
fclose($file);
}
?>
<FORM METHOD="post" ACTION="<?=$PHP_SELF; ?>">
<INPUT TYPE=hidden NAME="update" VALUE="yes">
<TEXTAREA NAME="text" COLS="100" ROWS="42">
<?
include "$filename";
?>
</TEXTAREA>
<P>
<INPUT TYPE=submit VALUE="Update Text">
</FORM>
the problem i have now is that its adding newlines everytime i update the file
for example
here is the file before:
1
2
3
when i update i get this:
1
2
3
4
anybody know why???