Skip to main content
November 19, 2014
Question

Sending Variables from Flash to PHP

  • November 19, 2014
  • 1 reply
  • 244 views

This is Probably going to be easy for you guys , I am New to AS3 so not for me Need your help at every step Folks

Here is my Script in AS3

var request:URLRequest = new URLRequest("http://valeurtechnologies.com/fmg/mail.php");
   var ldr_email:URLLoader = new URLLoader();
  
   var variables:URLVariables = new URLVariables();
  
   variables.subject = "Email from FMG Induction Portal";
  
  

   var str_message:String = "";
   str_message += "Name: Name";

   str_message += ("\nEmail:"+mc_popupEmail.txt_email.text);
   str_message += ("\nNumber of Correct Answers:"+cor_ans.text);
   str_message += ("\nNumber of Incorrect Answers:"+incor_ans.text);
   str_message += ("\nDate of Test:" + _dateTF.text);
   str_message += ("\nDuration of Test:"+_durationTF.text);

  
   variables.Message = str_message;

   request.data = variables;
  
   request.method = URLRequestMethod.POST;
  
   ldr_email.load(request);
  
   txt_status.text = "Result has been sent";
  
   txt_comments.text = "";

-----------------------------------------------------

My PHP is even worst than AS3 , so need your assistance in writing the right Script.

Here is what I got , see its very Basic

<?php

$text=$_POST['str_message']." ".$_POST['mc_popupEmail.txt_email'];

$to="umer.b4u@gmail.com";

$subject="Message from php";

mail($to,$subject,$text,"Content-Type: text/plain; charset=utf-8");

echo $text;

?>

Can you tell me how can I pass those Variables in so that the email I get shows the Content of the Variables in it

Once again , I know newbies are very Annoying , but I request you to be patient with me on dumb questions

Can I say , PLEASE HELP

This topic has been closed for replies.

1 reply

rezun8
Inspiring
November 19, 2014

AS3: Contact Form

this is a great walk thru on how to get this done

Hope it helps