6 Replies Latest reply on May 8, 2011 5:15 PM by kglad

    Contact us Form

    b_creative

      hi,i do a simple form but i dont know where is the wrong in it ,when i upload it ,it dosent work!! where is the wrong?

      i'm using AS2

       

       

      on send button:

       

      on (release) {
               if (nme eq "" or subject eq "" or messag eq "" or email eq "") {
                     gotoAndStop(22);
               } else {
               loadVariablesNum("contact.php", 0, "POST");
               gotoAndStop(25);
           }
      }

       

      on clear button:

       

      on (release) {
          nme = "";
          subject="";
          messag="";
          email="";
      }

       

      php code:

       

      <?php
      $to = "info@moonshadow-flowers.com";
         $msg = "$name\n\n";
         $msg .= "$message\n\n";

        mail($to, $subject, $msg, "Message From: Online client\nReply-To: $email\n");

      ?>

        • 1. Re: Contact us Form
          kglad Adobe Community Professional & MVP

          start debugging by correcting your php file:

           


           

          <?php
          $to = "info@moonshadow-flowers.com";

          $name=$_POST["name"];

          $message=$_POST["message"];

          $email=$_POST["email"];

          $subject="Message From: Online client";

             $msg = "$name\n\n";
             $msg .= "$message\n\n";

            mail($to, $subject, $msg, "Reply-To: $email\n\n");

          ?>

          • 2. Re: Contact us Form
            b_creative Level 1

            that is the result i recive

             

            Message From: Online client
            Reply-To: <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="14" COLOR="#990000" LETTERSPACING="0" KERNING="0">sam@yahoo.com</FONT></P></TEXTFORMAT>

             

             

            i only recieve his mail not the name or message or subject

            • 3. Re: Contact us Form
              Ned Murphy Adobe Community Professional & MVP

              Fix the variables to agree between the AS and the PHP... nam != name...  messag != message

              1 person found this helpful
              • 4. Re: Contact us Form
                kglad Adobe Community Professional & MVP

                like i said, that was a start.  you have a lot of problems but the biggest has been fixed.

                 

                now use:

                 

                 


                 

                <?php
                $to = "info@moonshadow-flowers.com";

                $name=$_POST["nme"];

                $message=$_POST["messag"];

                $email=$_POST["email"];

                $subject="Message From: Online client";

                $headers="From: $to\r\nContent-type: text/html\r\n";

                $headers.= "Reply-To: $email\r\n";
                $headers .= "\r\n";

                   $msg = "$name\n\n";
                   $msg .= "$message\n\n";

                  mail($to, $subject, $msg, $headers);

                ?>

                • 5. Re: Contact us Form
                  b_creative Level 1

                  thanks both

                   

                  kglad thats much better i recieve in my inbox without code around everything

                   

                  anyway

                  on (release) {
                           if (nme eq "" or subject eq "" or messag eq "" or email eq "") {
                                 gotoAndStop(22);
                           } else {
                           loadVariablesNum("contact.php", 0, "POST");
                           gotoAndStop(35); --------------------------------------------------------------------------massage sent
                       }
                  }

                   

                  it stop working??? it was working b4 i fix the php why it stop go to that frame ???

                  • 6. Re: Contact us Form
                    kglad Adobe Community Professional & MVP

                    there's nothing in your php that would affect that actionscript.  you must have changed something on the flash side.

                     

                    use the trace() function to debug.