AS3 to PHP not working for no reason!

seriously i tried many tutorial and the outcome are the same. Been 2 weeks i unable to continue on my work . Please help me to check whats wrong .

This is the flash code

import flash.events.*;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
import flash.net.navigateToURL;
stop();


bt_sub.addEventListener(MouseEvent.CLICK, ValidateAndSend);


function ValidateAndSend(event:MouseEvent):void

{    var _request:URLRequest = new URLRequest("write.php");
    
    _request.method = URLRequestMethod.POST
    

    var variables:URLVariables = new URLVariables()
    variables.text_txt = text_txt.text
    _request.data = variables
    
    var _loader : URLLoader = new URLLoader()
    _loader.dataFormat = URLLoaderDataFormat.VARIABLES
    _loader.addEventListener(Event.COMPLETE, dataOnLoad)
    _loader.load(_request)
    

}

function dataOnLoad(event:Event){
            if(event.target.data.writing=="Ok") {
               gotoAndStop(2)       
           } else 
          
               text_txt.text = "Error in saving submitted data"
        }

//get data from text


this is the php file

<?php


$wootext=$_POST['text_txt'];



// Strip slashes on the Local variables



$fp = fopen("test.txt", "w");
if(fwrite($fp, $wootext)) {echo "writing=Ok";}

else {echo "writing=Error";}

fclose($fp);

?>

i will attach all the files required… Thanks in advance.