Get variables from Action Script using PHP
Hi,
I need your help with a php issue here:
I have a flash form where the user enters some strings. Action Script is supposed to get these strings and place them into variables, then send the to php.
Now php gets these variables and places them inside other variables using $_POST, and then send them to my email.
The problem is that flash returns undefined every time the user clicks on submit.
My guess is that there is some sort of trouble in the communication between php and AS.
here is the php code (which I gues is the wrong one):
<?
$nombre=$_POST["nom"];
$ocupacion=$_POST["ocu"];
$nos_conoce=$_POST["conoc"];
$email=$_POST["ema"];
$para="aquipongomicorreo@gmail.com";
$asunto="envio de correo desde flash";
if (mail($para,$asunto,$ocupacion,$nombre)==true){
echo chr(38) . "resultado=ok";
}
and here is the AS code just in case:
boton.onRelease = function() {
var correo = new LoadVars();
correo.nom = nombre.text;
correo.ocu = ocupacion.text;
correo.conoc = nos_conoce.text;
correo.ema = email.text;
correo.sendAndLoad("correo.php",correo,"POST");
correo.onLoad = function() {
resultado.text = correo.res;
nombre.text = "";
ocupacion.text = "";
nos_conoce.text = "";
email.text = "";
};
};
G_S
Junior Poster in Training
98 posts since Mar 2010
Reputation Points: 13
Solved Threads: 2