# AS3 to PHP not working for no reason!

**URL:** <https://forum.kirupa.com/t/as3-to-php-not-working-for-no-reason/311824>\
**Category:** Uncategorized\
**Created:** [July 17, 2010, 8:18am UTC](https://forum.kirupa.com/t/as3-to-php-not-working-for-no-reason/311824 "2010-07-17T08:18:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![YenXz](https://avatars.discourse-cdn.com/v4/letter/y/eb9ed0/32.png) [@YenXz](https://forum.kirupa.com/u/YenXz)\
**Post date:** [July 17, 2010, 8:18am UTC](https://forum.kirupa.com/t/as3-to-php-not-working-for-no-reason/311824/1 "2010-07-17T08:18:51Z")

</div>

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

```auto
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

```auto
<?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.
