5 Replies Latest reply on Nov 17, 2006 1:27 AM by Missnana2004

    contact form not sending

      can someone pleae tell me what is wrong with this script? I am not receiving anything in my inbox.
        • 1. Re: contact form not sending
          A couple of things - first loadVariablesNum loads information *from* a file or script *into* Flash; it doesn't send it out.
          Second, all the variables need to be seperated with '&' symbols - you have one between 'subject' and 'feedback' (it starts the 'feedback' portion), but nowhere else.
          And lastly, if you can, you should try using a loadVars object instead. It gives you better control over the data you send out or receive in your Flash movie.
          For example, when all of your condition checking is done, to send the information, you could try this:
          • 2. Re: contact form not sending
            Missnana2004 Level 1
            Hi RemyR,

            I am new to flash can you please guide me step by step?

            I got my actionscript from a web tutorial, which by the way is wrong. I don't know to create new loadVars or anything I don't want to be a pain in the butt but, you don't know for how many days I've looking for this. So please bear with me I will trully appreciate it. If I paste this exactly how it is, will it work?
            • 3. Re: contact form not sending
              Missnana2004 Level 1
              like this?


              name = "";
              email = "";
              subject = "";
              comments = "";

              submit.onRelease = function() {
              feedbackpath = "mailto.php";

              str1 = email.indexOf("@");
              str2 = email.indexOf("@")+1;
              str3 = email.charAt(str1+1);
              str4 = email.lastIndexOf(".");
              str5 = email.charAt(str4+1);
              len = length(email);
              counter = 1;
              flag = 0;
              while (Number(counter)<=Number(len)) {
              Char = substring(email, counter, 1);
              if(Char ne "@") {
              flag = Number(flag)+1;
              counter = Number(counter)+1;
              if (name =="") {
              condition1 ="";
              namemark._visible = true;
              } else {
              condition1 = "ok";
              namemark._visible = false;
              if (str4<=str2 || str3=="." || str5 =="" || Number(flag) != Number(len-1)) {
              condition2 = "";
              emailmark._visible = true;
              } else {
              condition2 = "ok";
              emailmark._visible = false;
              if (subject =="") {
              condition3 ="";
              subjectmark._visible = true;
              } else {
              condition3 = "ok";
              subjectmark._visible = false;
              if (comments == "") {
              condition4 = "";
              commentsmark._visible = true;
              } else {
              condition4 = "ok";
              commentsmark._visible = false;

              if (condition1 == "ok" && condition2 == "ok" && condition3 == "ok" && condition4 == "ok") {
              var sendObj:loadVars = new loadVars ();

              sendObj.name = name;
              sendObj.email = email;
              sendObj.subject = subject;
              sendObj.feedback = comments;

              "?&name="+name+"&email="+email+"&subject="+subject+"&feedback="+comments, 0);

              sendObj.send(feedback, _self, "GET");

              reset.onRelease = function() {
              name = "";
              email = "";
              subject = "";
              comments = "";

              namemark._visible = false;
              emailmark._visible = false;
              subjectmark._visible = false;
              comments._visible = false;

              there is something wrong with line:
              "?&name="+name+"&email="+email+"&subject="+subject+"&feedback="+comments, 0);
              • 4. Re: contact form not sending
                RemyR Level 1
                Yeah. If your using loadVars, you can completely ignore that line. loadVars will process the variables for you, so just cut that line out of your code. Sorry, reading back over what I originally posted, I should have been clearer on that.

                I think it should work (though, I wouldn't trust me - I'm notorious for putting typos in my code), but there's a few things that could go wrong. The file 'mailto.php' needs to be in the same place as your published flash movie (the .swf file), and they need to be on a server that will process PHP code (so it probably won't work, even if it's coded right, on your personal computer).
                Also, I have at least one typo I see: where it says _self -- it should be in double quotes, like this:
                sendObj.send(feedback, "_self", "GET");

                Now, this will immediately move your web browser to a page that has 'mailto.php' 's return. Because the web tutorial added the gotoAndStop(2); code afterwards, I'm going to assume that that's not supposed to happen, and the Flash file is supposed to do something after it sends the data. It would be helpful if I knew what your FLA (your flash source file) or the web tutorial looked like.
                You can always go back to your original code, that line that's giving you an error should work with that. In other words, ignore everything I've said before and follow these directions:

                In your original posted code, change the line that reads:

                "?name="+name+"email="+email+"subject="+subject+"&feedback="+comments, 0);

                To this line:

                "?name="+name+"&email="+email+"&subject="+subject+"&feedback="+comments, 0);

                That way, you're not using a completely different function and having to rewrite alot more code.
                I hope (after all the run-around) this helps.
                • 5. Re: contact form not sending
                  Missnana2004 Level 1
                  Thank you soooooooooooo much you are great.

                  can you do me a favor and try it