I can write to XML file, I can read XML, but I can’t write to XML and then reload it

Hi Guys.
Thanks for looking at this request.

Basically I have a Flash file that writes to XML file (gameLogEvents.xml) via PHP, which actually works fine.
I can click on a button in my .swf which will append to my xml file all day no problem.

The problem is, when I try reload the XML into Flash I get an error ;

PHP Warning:  fopen("gameLogEvents.xml", "w") - Permission denied in c:\phpdev\www\public\saving-xml.php on line 51

What I can’t understand is why the XML will be written correctly, but when Flash attempts to reload the XML file, the above error is displayed. I have closed my .php file after writing to the XML file (gameLogEvents.xml).

May the below code from the main timeline will help ?.
//I have commented to try and help.

/*the below is connected an .AS file which sends the
data to php file to write to XML. When the //writeToXml function is invoked, 
it dispatches an event , which is picked up by the below line on the stage.*\


  //****************Stage***************


  todaysTeam.addEventListener(adminFiles.com.teamSelection.sendXML.UPDATE, redrawEvents);

  /*This is the function that is meant to be run when the XML is written. 
It calls on an external class to reload the xml. I have added “null” to the end
to try clear the XML but it didn’t work. *\
  
function redrawEvents(e:Event):void
  {              
  var gameEvents2:gameLogEvents=new gameLogEvents();
  gameEvents2.gameLogEvents2();
  addChild(gameEvents2);
  gameEvents2.x=300;
  gameEvents2.y=400;
  gameEvents2=null;
  }

  //****************Stage***************

When I take away the line : todaysTeam.addEventListener(adminFiles.com.teamSelection.sendXML.UPDATE, redrawEvents);
the PHP will write no problem. So the issue seems to be the recall of an XML into Flash, after the file has just been updated.

Has anyone any idea

Recap : I can write to XML file, I can read XML, but I can’t write to XML and then reload it straight away.