this is my as3 code which is sending variables to php
var myData:URLVariables = new URLVariables();
myData.firstName = "Kirill";
myData.lastName = "Poletaev";
var myRequest:URLRequest = new URLRequest("test.php");
myRequest.data = myData;
myRequest.method = URLRequestMethod.POST;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
try
{
loader.load(myRequest);
}
catch (error:Error)
{
trace('Error: unable to load the document.');
}
and this is my php code
<?php
$text=$_POST['firstName']." ".$_POST['lastName'];
$to="anubhavjhalani09@gmail.com";
$subject="Message from php";
mail($to,$subject,$text,"Content-Type: text/plain; charset=utf-8");
echo $text;
?>
my both fla and php files are in the same folder in the server.still when i execute php i m getting this error
Notice: Undefined index: firstName in C:\xampp\htdocs\flasblog\test.php on line 2
Notice: Undefined index: lastName in C:\xampp\htdocs\flasblog\test.php on line 2
somebody please help me