I am using this script from flash-db.net, now I am trying to modifiy it to only open the textfile and replace the older information with the new sent from flash. I just wanted to be as simple as possible I don't need the splitting of the data to different textportions. I don't know much about php so please explain carefully.

original script:
<?
if ($Submit == "Yes") {
#Next line tells the script which Text file to open.
$filename = "mytextfile.txt";

#Opens up the file declared above for reading

$fp = fopen( $filename,"r");
$OldData = fread($fp, 80000);
fclose( $fp );

#Puts the recently added data into html format that can be read into the Flash Movie.

$Input = "$Comments";

#This Line adds the 'GuestBook=' part to the front of the data that is stored in the text file. This is important because without this the Flash movie would not be able to assign the variable 'GuestBook' to the value that is located in this text file

$New = "$Input";

#Opens and writes the file.

$fp = fopen( $filename,"w+");
fwrite($fp, $New, 80000);
fclose( $fp );
}
################################################## ##################################
########## Formatting and Printing the Data from the Guestbook to the Flash Movie ##

#Next line tells the script which Text file to open.
$filename = "mytextfile.txt";

#Opens up the file declared above for reading

$fp = fopen( $filename,"r");
$Data = fread($fp, 80000);
fclose( $fp );

#Splits the Old data into an array anytime it finds the pattern .:::.
$DataArray = split (".:::.", $Data);

#Counts the Number of entries in the GuestBook
$NumEntries = count($DataArray) - 1;

print "&TotalEntries=$NumEntries&NumLow=$NumLow&NumHigh= $NumHigh&GuestBook=";
for ($n = $NumLow; $n < $NumHigh; $n++) {
print $DataArray[$n];
if (!$DataArray[$n]) {
Print "";
exit;
}
}

?>