Hi all As stated in my other posts i know nothing about php.

Ok what i am trying to do is make a form that when submited updates a .txt file and then displays the changes in the form. this is the code i have

Code:
<form name="title" method="POST" action="<?php echo $_SERVER['SCRIPT_NAME']?>">
		<div><textarea  name="title" cols="75" rows="15"><?php readfile("../text/homepage/title.txt");?> </textarea></div>
		<input type="submit" value="Save Changes" name="submit"><input type="reset" value="Reset Form" name="reset"></p>
</form>
<?php

if (isset($_POST['submit'])) {

$name = $_POST['title'];

}
?>

<?php

if (isset($_POST['submit'])) {

$name = $_POST['title'];

$fp = fopen("../text/homepage/title.txt","w+");

if(!$fp) {
    echo 'Error, the file could not be opened or there was an error creating it.';
    exit;
}
}
?>

<?php

if (isset($_POST['submit'])) {

$name = $_POST['title'];

$fp = fopen("../text/homepage/title.txt","w+");

if(!$fp) {
    echo 'Error, the file could not be opened or there was an error creating it.';
    exit;
}

fwrite($fp, $name."\n");

}
?>

<?php

if (isset($_POST['submit'])) {

$name = $_POST['title'];

$fp = fopen("../text/homepage/title.txt","w+");

if(!$fp) {
    echo 'Error, the file could not be opened or there was an error creating it.';
    exit;
}

fwrite($fp, $name."\n");

fclose($fp);
}
?>
it seems to work somwhat however after clicking save changes the page refreshes but not displaying the changes altho the changes are made in the .txt file, can anyone please help me to get it to display the changes in the form after hitting save changes.

also how do i get this code to make a new line of test actualy write it on a new line