I'm trying to use urlLoader but it's not working and I don't know why..
I've created a php file that I have uploaded. Here's the php code :
<?php
$psPreRegEmail=$_POST['sEml'];
$FRM_ID=$_POST['sID'];
$psBD=$_POST['sBD'];
echo "email=".$psPreRegEmail;
echo "&id=".$FRM_ID;
echo "&db=".$psBD;
?>
Here is my AS3 code :
var request:URLRequest = new URLRequest('http://www.mysite.fr/login.php')
var variables:URLVariables = new URLVariables()
variables.sEml = 'steph4'
variables.sID = 'steph5'
variables.sBD = 'steph6'
request.data = variables
request.method = URLRequestMethod.POST
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, handleComplete);
loader.load(request)
function handleComplete(event:Event) {
var loader:URLLoader = URLLoader(event.target)
var vars:URLVariables = new URLVariables(loader.data)
trace('vars.email: '+vars.email)
trace('vars.id: '+vars.id)
trace('vars.db: '+vars.db)
}
No errors, but when I'm going at http://www.mysite.fr/login.php it displays : email=&id=&db=
Why don't I see : ???
email=steph4
id=steph5
db=steph6
I'm starting to wonder if it's possible to send data from an AIR app to a php file on a server ?? Maybe it's because, for security measure, it's impossible to send data to an URL ?