Welcome, Guest
  • Author Topic: not passing variables....  (Read 18104 times)

    djangokill

    • Server what's that
    • *
    • Posts: 10
    • Flash-db Rules
      • View Profile
      • Email
    not passing variables....
    « on: 02/05/02, 12:16 »
    i've used the script and button actions pretty much as is from the tute. all the variable names are set properly etc and the script runs successfully. I get an email, but the spaces where the variables should be are blank. I have set it up to work with an html form and everything works perfectly. but for some reason flash isnt passing the variables into the php.

    any ideas??

    This is the script

    <?
    $ToEmail = "me@me.com";
    $ToName = "Me";
    $ToSubject = "Mail";

    $EmailBody = "Sent By: $FirstName\nSenders Email: $Email\n\nMessageSent:\n$ToComments\n\n";

    $EmailFooter="\nThis message was sent by: $FirstName from $REMOTE_ADDR If you feel that you recieved this e-mail by accident please contact us at www.yourSite.com";   

    $Message = $EmailBody.$EmailFooter;

    mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FirstName." <".$Email.">");

    Print "_root.contact_form.form_fields.EmailStatus=Complete - Your mail has been sent";
    ?>

    and this is on the button

    on (release) {
       if (_root.contact_form.form_fields.FirstName eq "") {
           EmailStatus = "Please Enter your name";
       } else if (!_root.contact_form.form_fields.Email.length || _root.contact_form.form_fields.Email.indexOf("@") == -1 ||_root.contact_form.form_fields.Email.indexOf(".") == -1) {
           EmailStatus = "Please enter a valid e-mail address";
       } else if (_root.contact_form.form_fields.ToComments eq "") {
           EmailStatus = "Please enter a message";
       } else {
           loadVariablesNum ("fumemail.php", 0, "POST");
           EmailStatus = "Sending... one moment please";
       }
    }


    cheers in advance

    djangokill

    Romwin

    • Server what's that
    • *
    • Posts: 35
    • Flash?... Whats Flash?
      • View Profile
      • Email
    Re:not passing variables....
    « Reply #1 on: 02/15/02, 15:41 »
    First thing I thought of is:  Are your variables posted on/in the same level or movie clip as your send button?

    You could try to add this to your send button:

    on (release) {
        if (_root.contact_form.form_fields.FirstName eq "") {
            EmailStatus = "Please Enter your name";
        } else if (!_root.contact_form.form_fields.Email.length || _root.contact_form.form_fields.Email.indexOf("@") == -1 ||_root.contact_form.form_fields.Email.indexOf(".") == -1) {
            EmailStatus = "Please enter a valid e-mail address";
        } else if (_root.contact_form.form_fields.ToComments eq "") {
            EmailStatus = "Please enter a message";
        } else {
            FirstName = _root.contact_form.form_fields.FirstName;
            Email = _root.contact_form.form_fields.Email.length;
            ToComments = _root.contact_form.form_fields.ToComments;
            loadVariablesNum ("fumemail.php", 0, "POST");
            EmailStatus = "Sending... one moment please";
        }
    }

    In the else statement I added the variables to be sent and what should be in those variables.  

    Hope that helps
    « Last Edit: 02/15/02, 15:42 by Romwin »
    Romwin out...

    djangokill

    • Server what's that
    • *
    • Posts: 10
    • Flash-db Rules
      • View Profile
      • Email
    Re:not passing variables....
    « Reply #2 on: 02/16/02, 07:11 »
    thanks, i got it sorted.

    i just tried declaring the variables before they are sent, and it works. thanks for your reply. but the button and vars are on the same timeline, so there was no problem there.

    cheers

    djangokill

    James

    • Server what's that
    • *
    • Posts: 9
      • View Profile
      • Email
    Re:not passing variables....
    « Reply #3 on: 02/11/04, 01:45 »
    I'm having the same problem and I don't quite understand the solution...
    My php script is sending, but my form doesn't seem to be sending any variables to the script.
    My send button is in the same movieclip as the input text fields and they all have original vars.

    my button script is as follows:
    on (release) {
          if (!Email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
          EmailStatus = "Please enter a valid E-mail address";
       }

       else if (!Name.length) {
          EmailStatus = "Please Enter your name before Sending";
       }

       else if (!Address.length) {
          EmailStatus = "Please enter your Address";
       }

       else if (!City.length) {
          EmailStatus = "Please Enter your City before Sending";
       }

       else if (!State.length) {
          EmailStatus = "Please Enter your State before Sending";
       }

       else if (!Zip.length) {
          EmailStatus = "Please Enter your Zip Code before Sending";
       }

       else if (!Phone.length) {
          EmailStatus = "Please Enter your Phone Number before Sending";
       }

       else if (!Home.length) {
          EmailStatus = "What is the value of your home?";
       }
       
       else {
          loadVariablesNum ("email.php", "0", "Post");
           EmailStatus = "Sending... one Moment .. or two.. sometimes it's faster then other times";
       }
    }

    my php script is:

    <?php
    $Email      = $HTTP_POST_VARS["Email"];
    $Name    = $HTTP_POST_VARS["Name"];
    $Address  = $HTTP_POST_VARS["Address"];
    $City = $HTTP_POST_VARS["City"];
    $State = $HTTP_POST_VARS["State"];
    $Zip = $HTTP_POST_VARS["Zip"];
    $Phone = $HTTP_POST_VARS["Phone"];
    $Home = $HTTP_POST_VARS["Home"];
    $Date = $HTTP_POST_VARS["Date"];
    $ToEmail = "jwoodley@sbbco.net";
    $ToName = "James";
    $ToSubject = "Seller Registration Test ";
    $EmailBody = "Sent By: $Name\nSenders Email: $Email\n\n Please send me my free sellers kit. My information is as follows:\n\n$Address\n$City\n$State\n$Zip\nMy phone number is: $Phone\nThe approximate value of my home is $Home\n The date I placed my property on the market is $Date\nMy EMM Rep is James Woodley. ID#41607\n";
    $EmailFooter="\nThis message was sent using James Woodley's automated registration system.";
    $Message = $EmailBody.$EmailFooter;
    mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$Name." <".$Email.">");Print "&_root.Mail.EmailStatus=Complete - Your mail has been sent&";
    ?>

    What could I be doing wrong?
    btw.. I love the site, I've learned so much!

    James

    • Server what's that
    • *
    • Posts: 9
      • View Profile
      • Email
    Re:not passing variables....
    « Reply #4 on: 02/15/04, 19:19 »
    Any ideas how I can fix my problem? How should I change my scripts???

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re:not passing variables....
    « Reply #5 on: 02/16/04, 03:22 »
    Hi,
    does it send mail?
    happy flashing
    8)
    Ronald

    James

    • Server what's that
    • *
    • Posts: 9
      • View Profile
      • Email
    Re:not passing variables....
    « Reply #6 on: 02/16/04, 23:00 »
    The script does send mail whent he script alone is tested. Yet nothing happens when the form is tested leaving me to believe the form isn't sending the variables to the script.

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re:not passing variables....
    « Reply #7 on: 02/17/04, 01:29 »
    show the action script which triggers the send
    happy flashing
    8)
    Ronald

    James

    • Server what's that
    • *
    • Posts: 9
      • View Profile
      • Email
    Re:not passing variables....
    « Reply #8 on: 02/17/04, 11:11 »
    my button script is as follows:
    on (release) {
          if (!Email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
         EmailStatus = "Please enter a valid E-mail address";
      }

      else if (!Name.length) {
         EmailStatus = "Please Enter your name before Sending";
      }

      else if (!Address.length) {
         EmailStatus = "Please enter your Address";
      }

      else if (!City.length) {
         EmailStatus = "Please Enter your City before Sending";
      }

      else if (!State.length) {
         EmailStatus = "Please Enter your State before Sending";
      }

      else if (!Zip.length) {
         EmailStatus = "Please Enter your Zip Code before Sending";
      }

      else if (!Phone.length) {
         EmailStatus = "Please Enter your Phone Number before Sending";
      }

      else if (!Home.length) {
         EmailStatus = "What is the value of your home?";
      }
     
      else {
         loadVariablesNum ("email.php", "0", "Post");
           EmailStatus = "Sending... one Moment .. or two.. sometimes it's faster then other times";
      }
    }

    James

    • Server what's that
    • *
    • Posts: 9
      • View Profile
      • Email
    Re:not passing variables....
    « Reply #9 on: 02/23/04, 14:13 »
    Any ideas?? ???

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re:not passing variables....
    « Reply #10 on: 02/23/04, 15:31 »
    Hi James,
    do you use vars or instancenames for the textfields?
    happy flashing
    8)
    Ronald

    James

    • Server what's that
    • *
    • Posts: 9
      • View Profile
      • Email
    Re:not passing variables....
    « Reply #11 on: 02/23/04, 15:48 »
    I use vars

    Roeland de Jong

    • Server what's that
    • *
    • Posts: 7
      • View Profile
      • get Qubed soon
    Re:not passing variables....
    « Reply #12 on: 03/22/04, 17:03 »
    James .. same problem here .. hope we get things sorted ..!
    this site is splendid .. the support is marvelous ..
    THNX for all that ..
    ;D ;D

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re:not passing variables....
    « Reply #13 on: 03/23/04, 02:05 »
    Hi James,
    and your varNames are exactly the same way written? With a capital letter at the beginning?

    Does it send something (empty mail), or doesnt it do nothing?

    Did you try to just echo the variables received?
    happy flashing
    8)
    Ronald

    James

    • Server what's that
    • *
    • Posts: 9
      • View Profile
      • Email
    Re:not passing variables....
    « Reply #14 on: 03/27/04, 00:50 »
    VarNames are exactly the same.
    Nothing happens at all.

    I don't really understand what you mean by echoing the variables...