Flash/PHP save to text file

I found a good tutorial explaining how to save data from a Flash form into a text file. But something is wrong because it isn’t working on my server (which has PHP support). Here is the actionscript:


 [LEFT]submit.onPress = function(){
if(Title.text!="" && Comments.text !=""){
myData.Title = Title.text
myData.Comments = Comments.text
myData.sendAndLoad("save.php", myData, "POST")
myData = new LoadVars()
myData.onLoad = function(){
   if(this.writing=="Ok") {
   status.text = "Submited data was saved"
   else status.text = "Error in saving submitted data"

And here is the PHP code:


   $title = $_POST['Title']; 
   $comments = $_POST['Comments']; 
   $toSave = "Title=".$title."&Comments=".$comments.; 
   $fp = fopen("news.txt", "w"); 
   if(fwrite($fp, $toSave)) echo "writing=Ok"; 
   else echo "writing=Error"; 

Is there something wrong in these scripts? I was also reading about chmod permissions on another site, would I have to change these for the file to work? I pretty confused about what’s wrong. My Flash file is also attached, I’ll appreciate any help.[/COLOR][/COLOR][/LEFT]