1 Reply Latest reply on Feb 2, 2007 8:02 PM by jonnybennett

    OMG! Please help me with some actionscript for a flash .php form

    satrop Level 1
      Wright I've been trying for ages to get this to work. I have 10 combo boxes and tow input text fields in a "_mc" named "form" one send button with the following code on it.

      on (release) {
      form.loadVariables("email.php", "POST");
      }

      I then have this code on the ".php" file.

      <?php
      $sendTo = "steven@birkenstockbeach.com";
      $subject = "Custom Sven Clog Order Form";

      $headers = "From: " . $_POST["name"];
      $headers .= "<" . $_POST["email"] . ">\r\n";
      $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
      $headers .= "Return-Path: " . $_POST["email"];
      $email .= $_POST["email"];
      $name .= $_POST["name"];
      $message .= $_POST["treadColor"];
      $message .= $_POST["baseColor"];
      $message .= $_POST["bendOrNon"];
      $message .= $_POST["heelSize"];
      $message .= $_POST["nubucColors"];
      $message .= $_POST["galaxyColors"];
      $message .= $_POST["suedeColors"];
      $message .= $_POST["patentColors"];
      $message .= $_POST["leatherColors"];
      $styles .= $_POST["styles"];
      mail($sendTo, $subject, $message, "nEmail = $email\nStyles = $styels\nName = $name";
      ?>

      I've looked at all the normal stuff that might be wrong, is the "email.php" file on the server? Yes!. Is the ".swf" file on the server? Yes! I just cant get the code wright! The form is made in "flash 8 PRO" And the ".swf" file is in a Dreamweaver site. Well the hole thing is in a Dreamweaver site.
      I fill out the form hit send and all I get back is blank email with the name, sent to and subject lines filed out. AAAAAAAARrrrrrrrrrr!
      Someone please for the of it all tell me wear the hell I have gone wrong? I thank you all for taking the time to read this!!!!
        • 1. Re: OMG! Please help me with some actionscript for a flash .php form
          jonnybennett Level 1
          Firstly again, your php script, you have now put a '.' infront of all of the variables.
          The '.' consentinas a string. It should read....

          <?php
          $sendTo = "steven@birkenstockbeach.com";
          $subject = "Custom Sven Clog Order Form";

          $headers = "From: " . $_POST["name"];
          $headers .= "<" . $_POST["email"] . ">\r\n";
          $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
          $headers .= "Return-Path: " . $_POST["email"];
          $email = $_POST["email"];
          $name = $_POST["name"];
          $message = $_POST["treadColor"];
          $message .= $_POST["baseColor"];
          $message .= $_POST["bendOrNon"];
          $message .= $_POST["heelSize"];
          $message .= $_POST["nubucColors"];
          $message .= $_POST["galaxyColors"];
          $message .= $_POST["suedeColors"];
          $message .= $_POST["patentColors"];
          $message .= $_POST["leatherColors"];
          $styles = $_POST["styles"];

          Also you need to close the brackets in your mail() function....

          mail ($sendTo, $subject, $message,$headers);

          That is the first problem. Your big problem is that you aren't sending any of the variables from your swf, to the php file.
          You need to look up loadVars(). I don't think you can use loadVariables, as you want to send the variables to php, not recieve them. You can use loadVars to sendAndLoad variables to the php... be it 'email','name' etc and the php script will email them.