1 Reply Latest reply on Jun 10, 2009 10:57 AM by C-Rock

    New to contact forms

    toshay76

      I am trying to make a contact form in flash and I am not recieving the email after it is sent. Can you tell me what I have done wrong?

       

       

       

      Flash Action Code:

       

      rec="shay.williams@aspenhome.net";
      serv="php";

       

      var fields_descriptions= Array ("",
                                           Array("t1", "your_name", "your name:"),
                                           Array("t2", "your_email", "e-mail:"),
                                           Array("t3", "telephone", "telephone:"),
                                           Array("t4", "your_company", "your company:"),
                                           Array("t5", "your_position", "position:"),
                                           Array("t6", "your_city", "city:"),
                                           Array("t7", "your_state", "state:"),
                                           Array("t8", "your_country", "country:"),
                                           Array("t9", "calltime", "best time to call:"),
                                           Array("t10", "other", "other:"),
                                           Array("t11", "your_revenue", "annual revenue:")
                                       );

       

       

       

      for (i=1; i<=fields_descriptions.length; i++) {
           this["k"+i].text=fields_descriptions[i][2];
      }

       

       

       

      Send Button Code:

       

      on (rollOver) {
           this.gotoAndPlay("s1");
      }
      on (releaseOutside, rollOut) {
           this.gotoAndPlay("s2");
      }

       

       

       

      on (release) {
           for (i=1; i<_parent.fields_descriptions.length; i++) {
               if (_parent[_parent.fields_descriptions[i][1]]!=_parent.fields_descriptions[i][2]) {
                   this[_parent.fields_descriptions[i][1]]=_parent[_parent.fields_descriptions[i][ 1]]+"&777&"+_parent.fields_descriptions[i][2];
               }
               _parent.reset_txt(_parent["t"+i], _parent.fields_descriptions[i][1], _parent.fields_descriptions[i][2]);
           }

       

          this.recipient=_parent.rec;
           getURL("contact."+_parent.serv, "_blank", "POST");
          
      }

       

       

      PHP Code:

       

      <?php
      Error_Reporting(E_ALL & ~E_NOTICE);

       

      while ($request = current($_REQUEST)) {
            if (key($_REQUEST)!='shay.williams@aspenhome.net') {
               $pre_array=split ("&777&",  $request);
              
               $post_vars[key($_REQUEST)][0]=preg_replace ("/<[^>]*>/", "", $pre_array[0]);
               $post_vars[key($_REQUEST)][1]=preg_replace ("/<[^>]*>/", "", $pre_array[1]);
           }
           next($_REQUEST);
      }

       

       

       

      reset($post_vars);

       


      $subject="From ".$post_vars['your_name'][0] ;
      $headers= "From: ".$post_vars['your_email'][0] ."\n";
      $headers.='Content-type: text/html; charset=iso-8859-1';
      $message='';
         while ($mess = current($post_vars)) {
             if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) {

       

               $message.="<strong>".$mess[1]."</strong>   ".$mess[0]."<br>";
           }
           next($post_vars);
      }

       

      mail($_REQUEST['shay.williams@aspenhome.net'], $subject,  "
      <html>
      <head>
      <title>Contact letter</title>
      </head>
      <body>
      <br>
         ".$message."
      </body>
      </html>" , $headers);
      echo ("Your message was successfully sent!");

       

      ?>
      <script>
           resizeTo(300, 300);
      </script>

       

       

      Thanks for you help in advanced - I know I am probably over my head.

       

      toshay

       

        • 1. Re: New to contact forms
          C-Rock Level 2

          I would suggest doing a trace right before you send the information to PHP. Make sure all of your required fields are tracing correctly. Also make sure you have no null or undefined items. If it's tracing correctly then take a closer look at PHP, I only use Coldfusion so I can't help there.