7 Replies Latest reply on Oct 31, 2007 10:38 PM by kglad

    Actionscript, PHP shown

    Mary_Alice Level 1
      Well, I will try to explain.
      First, the FORM: it consists of 9 areas of input. Household --input field next to it and there are input fields next to each of the others: Your Water Supply, Your Present Water Softner, Where do you get your bottled water from, Comments, Name/Business, Address, City-State-Zip, Phone, Email.
      QUESTION: can one have that many areas, 9 areas for viewer to input?
      The ACTIONSCRIPT for the FORM:
      on (release) {
      form.loadVariables("analysisformphp.php", "POST");
      }
      -------------------
      SUBMIT BUTTON is on the form at bottom. (it is a movie clip with instance name button. It shows the icon for movie clip in Properties; however, it shows in Component Inspector with a button icon)

      The ACTIONSCRIPT for the SUBMIT button:
      on (release) {
      form.loadVariables("analysisformphp.php", "POST");
      }
      ----------------------

      In the PHP file, the script is:

      <?php

      $sendTo = "art.design@comcast.net";
      $subject = "Analysis form reply";

      $headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n";
      $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
      $headers .= "Return-path: " . $_POST["email"];
      $message = $_POST["message"];

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

      ?>
        • 1. Re: Actionscript, PHP shown
          kglad Adobe Community Professional & MVP
          your php doesn't appear to match your textfields and your actionscript code isn't going to work. attached to your button:

          instead of

          form

          use

          this._parent
          • 2. Re: Actionscript, PHP shown
            Mary_Alice Level 1
            I revised the submit button script to:

            on (release) {
            this._parent.loadVariables("analysisformphp.php", "POST");
            }
            --------------------------------------------------

            And I revised the PHP script to the following: I will see if it works after uploading to server, which I plan to do upon my return this afternoon.

            <?php

            $SendTo = "art.design@comcast.net"
            $subject = "My AnalysisForm Reply";

            $headers = "From: " . $_POST["household"];
            $headers = "From: " . $_POST["water supply"];
            $headers = "From: " . $_POST["softener"];
            $headers = "From: " . $_POST["bottled water"];
            $headers = "From: " . $_POST["comments"];
            $headers = "From: " . $_POST["name/business"];
            $headers = "From: " . $_POST["address"];
            $headers = "From: " . $_POST["city/state/zip"];
            $headers = "From: " . $_POST["phone"];
            $headers .= "<" . $_POST["email"] . ">\r\n";
            $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
            $headers .= "Return-Path: " . $_POST["email"];

            $message = $_POST["message"];

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

            ?>
            • 3. Re: Actionscript, PHP shown
              kglad Adobe Community Professional & MVP
              no, you don't want all those variables in the header. add them to your $message and fix your $headers variable.

              and you aren't passing a variable named message, so you can remove that. also, remove the next-to-last line. and either use $sendTo or $SendTo in both lines, but not one of each.
              • 4. Re: Actionscript, PHP shown
                Mary_Alice Level 1
                I revised and just now uploaded the revised files. (I was going to wait until later but I am anxious to see it it would work this time.) I went to the site I designed, typed in the input areas form information. Then, I clicked the submit button--it goes nowhere. I looked in my email and no form information has been sent.

                No, the form information still does not come into my email. I need help on this. There is something that is not correct. Please advise.

                Mary Alice
                art.design@comcast.net
                • 5. Re: Actionscript, PHP shown
                  kglad Adobe Community Professional & MVP
                  there's a lot that's not correct: read my above message.

                  and make sure everyone has read and execute permissions for your php file.
                  • 6. Re: Actionscript, PHP shown
                    Mary_Alice Level 1
                    Is this correct? I have not tested it yet.

                    SUBMIT button script to:

                    on (release) {
                    this._parent.loadVariables("analysisformphp.php", "POST");
                    }
                    --------------------------------------------------

                    I have all those variables in my form!? Aren't those variables supposed to be in the headers????
                    Sorry, but I do not understand:
                    "no, you don't want all those variables in the header. Add them to your $message and fix your $headers variable".

                    Also, I do not understand about 'permissions'. "You mentioned: "Make sure everyone has read and executed permissions for your php file".

                    Please kindly explain about those variables...where is the message they are supposed to be in?.

                    Here is the PHP script with the message removed:

                    <?php

                    $SendTo = "art.design@comcast.net"
                    $subject = "My AnalysisForm Reply";

                    $headers = "From: " . $_POST["household"];
                    $headers = "From: " . $_POST["water supply"];
                    $headers = "From: " . $_POST["softener"];
                    $headers = "From: " . $_POST["bottled water"];
                    $headers = "From: " . $_POST["comments"];
                    $headers = "From: " . $_POST["name/business"];
                    $headers = "From: " . $_POST["address"];
                    $headers = "From: " . $_POST["city/state/zip"];
                    $headers = "From: " . $_POST["phone"];
                    $headers .= "<" . $_POST["email"] . ">\r\n";
                    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
                    $headers .= "Return-Path: " . $_POST["email"];

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

                    ?>
                    • 7. Re: Actionscript, PHP shown
                      kglad Adobe Community Professional & MVP
                      i pointed out about 4 errors. you corrected one.

                      start with: