Hi, i read a older entry on this forum claiming that it works to update flat file entries with php is that correct?

i tried out the code below and it gets the records from the flatfile but it wont let me update it , is that possible ?

the code

<?php
if ($changefile) {
$slash = stripslashes($_POST['filetest']);
$filetochange = "http://yoursite.com/file.txt;
$filetochangeOpen = fopen($filetochange,"w") or die ("Error editing.");
fputs($filetochangeOpen,$slash);
fclose($filetochangeOpen) or die ("Error Closing File!");
}
?>
<form method=post action="">

<textarea rows="40" cols="60" name="filetest">
<?
// Implode CSS
$filetochange = "http://yoursite.com/file.txt";
print (implode("",file($filetochange)));
?>
</textarea><br />

<br />
<input type="submit" value="Change File" name="changefile">
</form>