Ok I have now changed my script to:
<?php
if($submit)
{
$fp = fopen($file, "text.txt");
fread($fp, filesize($fp));
fwrite($fp, $edittext);
}
else
{
if($file)
{
echo "<form method=\"post\" action=\"$PHP_SELF\">";
echo "<textarea name=\"edittext\" cols=\"20\" rows=\"20\">";
readfile($file);
echo "</textarea">";
echo "<input type=\"submit\" name=\"submit\">";
}
else
{
echo "<form method=\"post\" action=\"$PHP_SELF\">";
echo "<input type=\"text\" name=\"file\">";
echo "<input type=\"submit\" name=\"submit\">";
}
?>
Now I'm not geting an error on line 5 anymore so I guess thats fixed. But now I'm geting an PARSE error on 16.
echo "<input type=\"submit\" name=\"submit\">";
Is there something wronge with this code?