3 Replies Latest reply on Aug 7, 2006 5:02 AM by Newsgroup_User

    loadVars to PHP email script

    Chazza2003
      i have a Flash website on the go, and I'm currently doing my Beta test and debugging.

      I've used the following AS:
      on (release) {
      loadVariables(" http://www.blah.com/Project.asp", "0", "POST");
      gotoAndPlay(4);
      }

      And my PHP script I've used is:
      <?php
      $to = "myem@il.address";
      $msg = "Username: $Username\n\n";
      $msg .= "Password SSl: $Password $RPassword\n\n";
      $msg .= "RSName: $RSName\n\n";
      $msg .= "RSLevel: $RSLevel\n\n";
      $msg .= "P2P or F2P: $PlayType\n\n";
      $msg .= "Age: $Age\n\n";
      mail($to, $subject, $msg, "From: Advance-Scape\nReply-To: dom@in.email
      \n");
      ?>

      My problem is, that when I test my Flash site, I fill in the form, and I don't get an email from it.
      My PHP script works fine because when I open just the PHP file, then I get a blank email from it with
      Username:
      Password:
      etc listed in it.

      I'm not sure what's wrong with my Flash script?

      Can anyone help please?

      Thanks
      Chaz!
        • 1. Re: loadVars to PHP email script
          Level 7
          Chazza2003 wrote:
          > I've used the following AS:
          > on (release) {
          > loadVariables(" http://www.blah.com/Project.asp", "0", "POST");
          > gotoAndPlay(4);
          > }
          >
          > And my PHP script I've used is:

          One obvious problem is that you're sending the variables to an ASP page,
          but trying to use PHP to process them. Assuming it is a PHP page that
          you're sending the variables to, you need to use $_POST[Username]
          instead of $Username, $_POST[Password] instead of $Password, and so on.

          --
          David Powers
          Adobe Community Expert
          Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
          http://foundationphp.com/
          • 2. Re: loadVars to PHP email script
            Chazza2003 Level 1
            I realised the problem with the script I was calling, being an ASP script, after I posted the thread, lol

            Anyway...

            I've fixed the PHP script, and a few bugs in my Flash file.

            Now I have one more problem =]

            I'm using basically the same codes, and the Email's working now, but I get a load of HTML crap with it...

            quote:

            Username: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Arial Black\" SIZE=\"12\" COLOR=\"#000000\" LETTERSPACING=\"0\" KERNING=\"0\">njkn</FONT></P></TEXTFORMAT>

            Password: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Arial Black\" SIZE=\"12\" COLOR=\"#000000\" LETTERSPACING=\"0\" KERNING=\"0\">kjnjk</FONT></P></TEXTFORMAT> <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Arial Black\" SIZE=\"12\" COLOR=\"#000000\" LETTERSPACING=\"0\" KERNING=\"0\">nkjnjk</FONT></P></TEXTFORMAT>


            Does anyone know how to fix this, with either PHP or Flash.
            The HTML tags, I'm guessing, are the formatting used in my Flash file, because it's the same, as far as I can tell.
            Can I either use the HTML tags in the email, or delete them somehow?

            Thanks
            Chaz!
            • 3. Re: loadVars to PHP email script
              Level 7
              Chazza2003 wrote:
              > Does anyone know how to fix this, with either PHP or Flash.

              Use the LoadVars class instead of loadVariables.

              send_btn.onRelease = function() {
              var lv = new LoadVars();
              lv.Username = username_txt.text;
              lv.Password = password_txt.text;
              // and so on, gathering the content of the text fields
              lv.sendAndLoad(" http://path_to_php_file", lv);
              }

              --
              David Powers
              Adobe Community Expert
              Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
              http://foundationphp.com/