8 Replies Latest reply on Jul 29, 2006 9:40 AM by NCSO

    Sending email to php

    NCSO
      The flash form has an input textbox for Name (var=t1), email (var=t2), phone (var=t3) and finally comments (var=t4) * each input textbox has no instance name
      The flash has (2) buttons "Reset" and "Submit" respectfully.

      The reset button as the following code to clear the input textboxes:
      on (rollOver) {
      gotoAndPlay("t1");
      }
      on (releaseOutside, rollOut) {
      gotoAndPlay("t2");
      }
      on (release) {
      _parent.t1 = "";
      _parent.t2 = "";
      _parent.t3 = "";
      _parent.t4 = "";
      }

      The submit button has the following code

      on (rollOver) {
      gotoAndPlay("t1");
      }
      on (releaseOutside, rollOut) {
      gotoAndPlay("t2");
      }
      on (release) {
      email_lv = new LoadVars();
      result_lv = new LoadVars();
      //
      result_lv.onLoad = function(success:Boolean) {
      if (success) {
      }
      };
      email_lv.phone = _parent.t3;
      email_lv.email = _parent.t2;
      email_lv.name = _parent.t1;
      email_lv.comments = _parent.t4;
      email_lv.sendAndLoad(" http://www.gsquaredcc.com/myPHPscript.php", result_lv, "POST");
      _parent.t1 = "";
      _parent.t2 = "";
      _parent.t3 = "";
      _parent.t4 = "";
      }


      The PHP filename is myPHPscript.php and is located in the same directory as the .swf file
      <?php
      $phone = $_POST['phone'];
      $email = $_POST['email'];
      $name = $_POST['name'];
      $comments = $_POST['comments'];

      //This is the email address that the form will send the information to.

      $AdminEmailAddress = "ggaskill@gsquaredcc.com";

      $AdminMessage = "$name submitted the following Information:\n";
      $AdminMessage .= "Email: $email\n";
      $AdminMessage .= "Phone: $phone\n";
      $AdminMessage .= "Comments:\n";
      $AdminMessage .= "$comments\n";
      mail("$AdminEmailAddress", $AdminMessage, "From: $email");
      ?>


      Please assist with the PHP file as well, if you do not mind. I know that PHP is configured on the hosting server, I have verified it with a static:
      <?php
      mail("ggaskill@gsquaredcc.com", "test message", "test message", "From: gaskill@domainname.net");
      print "MAIL SENT";
      ?>

      If you need any more info, please let me know. I would love to put this behind me. I have been banging my head for (4) days.

      If you would like to look at the actual form, go to http://www.gsquaredcc.com and look under the "Contacts" Section

      PLEASE HELP!!!

      .swf and .fla available if needed.