0 Replies Latest reply on Apr 10, 2014 7:37 AM by Captain825

    Submitting Form Data HTTPService

    Captain825 Level 1

      I would appreciate some help with this.  I am using Flash Builder 4.6 and I am trying to submit some form data to a php file so the php file can send an email.  I am not that experienced with this and was hoping someone can show me what I am doing wrong.  I am not too concerned about the lack of security in the php file yet as I am still trying to get it to send the email.


      Here is the Flex Code:     





                  import mx.rpc.events.ResultEvent;

                  import mx.rpc.events.FaultEvent;

                  import mx.controls.Alert;


                  public function handlePlain(event:ResultEvent):void


                  Alert.show("OK Good");



                  public function handleFault(event:FaultEvent):void


                  Alert.show(event.fault.faultString, "Error");








      <s:HTTPService id="login_email"







      <mx:request xmlns="">

















      Here is the PHP File:


      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml">



      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

      <title>Untitled Document</title>







                  $first = $_POST['first_name'];

                  $last = $_POST['last_name'};

                  $email = $_POST['email'];

                  $comments = $_POST['comments'];


                  $to = 'myemailaddress@aol.com';

                  $subject = 'Contact from EPK';

                  $msg =  "$first\n"."$last\n"."email\n"."comments\n";


                  mail($to, $subject, $msg, 'From: ".$email);





















      Any help would be greatly appreciated.