dcsimg
A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: PHP mail form...please fix

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Posts
    102
    Okay guys, here's what's going on.
    First, go check out my website <http://www.brentrobbins.com>. On the "contact" page I have my mailform. It does not work, it just sits there and says, "Sending Data...."

    HERE'S THE SCRIPT FOR THE PHP FILE (pasted directly):

    <?php


    $TextVariable = '&results=';
    $response = 'Data Sent. Thank You..';


    echo $TextVariable;
    echo $response;

    /* recipients */
    $recipient .= "<brent@brentrobbins.com>" ;

    /* subject */
    $subject = "Your Automail";

    /* message */
    $message .= "Name: $name
    Email: $email
    Comments: $comments\n";

    /* additional header pieces for errors, From cc's, bcc's, etc */
    $headers .= "From: $name <$email>\n";


    /* and now mail it */
    mail($recipient, $subject, $message, $headers);


    ?>

    AND HERE'S THE SCRIPT I HAVE FOR MY 'SUBMIT' BUTTON:

    on (release) {
    // logical operator checks length. IndexOf checks for "@" and "." characters in e-mail
    if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
    results = "Please check your e-mail address.";
    } else if (!comments.length) {
    results = "Please enter your comments.";
    } else if (!name.length) {
    results = "Please enter your name.";
    } else {
    loadVariablesNum ("http://www.brentrobbins.com/mailform.php", 0, "GET");
    results = "Sending Data...";
    }
    }

    I HAVE THREE INPUT TEXT FIELDS CALLED, "name," "email," and "comments," and one dynamic text called, "results."

    OKAY SO WHAT AM I DOING WRONG?

  2. #2
    Is your mail form inside of a movie clip?

    I always avoid loading variables to level 0. If I am not requesting a response I will use level 0 otherwise I use the target path. Try entering the relative or direct path such as "_root" or "_root.formMC".

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Posts
    102
    Yes, my mailform is a loaded movie clip. Could this be the trouble???

  4. #4
    Yes, absolutly... if it is loaded into a target with an intance name you need to specify the path:

    loadVariables("http://www.brentrobbins.com/mailform.php", "_parent.thisMCName", "Get");

  5. #5
    Senior Member
    Join Date
    Jul 2001
    Posts
    102
    Please tell me what "_parent" is equal to. Do I just put, "_parent?"

    Secondly, I know this stands for "this Movie Clip Name" but do I put the name of the movie clip with the form or the movie clip I load the movie clip into? Does that make sense?

  6. #6
    Senior Member
    Join Date
    Jul 2001
    Posts
    102
    Okay okay, here's what I got.

    In the main movie, I have a movie clip labeled "rightcliploader." I load the contact page named, "R12" into rightcliploader. Therefore, should my command be:

    loadVariables("http://www.brentrobbins.com/mailform.php", "_parent.rightcliploader", "Get");

    ???

  7. #7
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi Brent,

    your movie loads from your purdue.edu address, so it wont send to a cgi on a brentrobbins address
    The syntax for loadvariables should not have quote marks around that _parent.rightcliploader
    BTW: how come that I should get flash 5.. I already have it and F6 not yet there

    Musicman

  8. #8
    Hi Brent,

    It sounds like Musicman knows what he is talking about but the "_parent.rightcliploader" DOES need to have quotes around it. This is one of those functions that takes the target as a string.

    I do this all the time... I believe that once you load the movie clip into your main time line you should be able to load variables from brentrobbins.com even if you loaded it from another web site. The test would be whether the cgi-script is sending the email to you. If it is then modifying the target in loadVariables will work and you should get the results back.

  9. #9
    Senior Member
    Join Date
    Jul 2001
    Posts
    102
    IT WORKS IT WORKS!!!!!!!

    Okay, I originally had my script as:
    loadVariables("http://www.brentrobbins.com/mailform.php", "_parent.rightcliploader", "Get");

    I changed it to:
    ("http://icdweb.cc.purdue.edu/~robbinba/mailform.php", _parent.rightcliploader, "Get");

    and now it works. So, was the problem the quotes or the address in which I loaded the variables?

    Musicman: why do you say that I said you need Flash 5.0? Did that html page come up saying you do? If so, let me know cuz I got some questions on that.

  10. #10
    It looks like it works with or without the quotes, so I take back what I said before the problem must have been where you were trying to send the data.

  11. #11
    Senior Member
    Join Date
    Jul 2001
    Posts
    102
    Thanks KenDaMan and Musicman!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center