# as3 and php

**URL:** https://forum.kirupa.com/t/as3-and-php/317597
**Category:** Uncategorized
**Created:** [December 26, 2010, 10:48pm UTC](https://forum.kirupa.com/t/as3-and-php/317597 "2010-12-26T22:48:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![luoruize](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@luoruize](https://forum.kirupa.com/u/luoruize)
#### Post date: [December 26, 2010, 10:48pm UTC](https://forum.kirupa.com/t/as3-and-php/317597/1 "2010-12-26T22:48:01Z")

</div>

Hey guys,  
Something weird is happening to me, and I don’t know how to solve this. What’s frustrating me is that In the past this worked just fine for me, and now it doesn’t for some reason.  
What I’m trying to do is send some variables from flash to php, and receive some other variables back (ultimately this will be used for getting info from a DB), right now all the PHP file does is return the same value sent to it.  
If someone could just go over it for a few seconds and let me know what I’m doing wrong, I’d appreciate it.

here’s the as3 code:

```auto

import flash.net.*;
import flash.events.Event;

var urlVars:URLVariables = new URLVariables();
urlVars.sendInfo = "blabla";

var urlReq:URLRequest = new URLRequest("website/getPlayerFromDB.php");
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
urlReq.data = urlVars;
urlReq.method = URLRequestMethod.POST;
urlLoader.addEventListener(Event.COMPLETE,comp);
urlLoader.load(urlReq);

function comp(e:Event):void {
	var vars:URLVariables = new URLVariables(e.target.data);
	for(var i in vars)
		trace(i+": "+vars*);
}

```

And here’s the php code:

```auto

<?php
	
	$info = $_POST['stuff'];
	
	echo "result=".$info;	
?>

```
