4 Replies Latest reply on Nov 17, 2006 8:56 AM by jonnybennett

    php form

    Missnana2004
      can someone tell me why I am not receiving this at my email?
        • 1. php form
          jonnybennett Level 1
          Which part is not working? is it the php or actionscript? To be honest the php script looks fine, however the actionscript on the previous post I would use loadVars to send to php. Also that way you could test to see if the variables are being passed to php, or whether it is the php that isn't working. Also are you sending to a hotmail or google email? if so check your junk email as it might be filtered as junk.
          • 2. Re: php form
            jonnybennett Level 1
            Here is an example of the actionscript I would use ... also remeber if you choose to use this code to change your php to POST, and not GET... another advantage to this way!
            • 3. Re: php form
              Missnana2004 Level 1
              Ok this is what I have now, should I change it or totally erase it?

              stop();

              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") {
              loadVariablesNum(feedbackpath+
              "?name="+name+"email="+email+"subject="+subject+"&feedback="+comments, 0);
              gotoAndStop(2);
              }
              };

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

              namemark._visible = false;
              emailmark._visible = false;
              subjectmark._visible = false;
              comments._visible = false;
              };
              • 4. Re: php form
                jonnybennett Level 1
                I have just got your message. I assume you haven't just copied and pasted my code?, because you will need to change and add you own names for the instance names for the textfields that are in the form. Also in my code....

                sendMessage.userName=name.text;

                'userName' will be the name of the variable sent to php for the name text..
                eg...
                $namenew = $_POST['userName'];


                ....okay hold up... this is what the php should look like for my code... but you still need to change textfield instance names in your flash.

                <?

                $to = "me@myemail.com";


                $namenew = $_POST['userName'];


                $emailnew = $_POST['userEmail'];


                $subjectnew = $_POST['userSubject'];


                $feedbacknew = $_POST['userMessage'];


                $matter = "Below are the details filled by"." "."$namenew"."\n\n".
                "Name:"." "."$namenew"."\n\n".
                "Email:"." "."$emailnew"."\n\n".
                "Subject:"." "."$subjectnew"."\n\n".
                "Comments:"." "."$feedbacknew"."\n\n";


                mail("$to", "$subject","$matter","From: $emailnew");

                ?>