<?php

if($_POST&#91;'Submit']){

$open = fopen("general.txt","w+");

$text = $_POST&#91;'update'];

fwrite($open, $text);

fclose($open);

echo "File updated.&lt;br />"; 

echo "File:&lt;br />";

$file = file("myfile.txt");

foreach($file as $text) {

echo $text."&lt;br />";

}

}else{

$file = file("textfile.txt");

echo "&lt;form action=\"".$PHP_SELF."\" method=\"post\">";

echo "&lt;textarea Name=\"update\" cols=\"50\" rows=\"10\">";

foreach($file as $text) {

echo $text;

} 

echo "&lt;/textarea>";

echo "&lt;input name=\"Submit\" type=\"submit\" value=\"Update\" />\n

&lt;/form>";

}

?>