A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Easy Form Question

  1. #1
    I'm sure it's something stupid, but i'm having this problem:

    I have a simple contact form, with 3 input fields with variable names name, email, and message. (do i need to give them instance names?)

    Here's the code on my submit button:

    on (release) {
    subject = "blah";
    recipient = "matt@wakemediagroup.com";
    loadVariablesNum("/cgi-sys/formmail.pl", 0, "POST");
    gotoAndPlay("submit");
    }


    not only does it not submit anything, it woun't even go to the "submit" frame. I've tried using the /cgi-sys/formail.pl in html forms in the same directory and they go through fine so i know it's not that.

    Please Help

  2. #2
    please help!!! i need this to work.

  3. #3
    gskinner.com
    Join Date
    Feb 2002
    Location
    N.America
    Posts
    455
    It sounds like your release action isn't triggering.

    Add a trace action like this:

    on (release) {
    trace("name: " + name);
    subject = "blah";
    recipient = "matt@wakemediagroup.com";
    loadVariablesNum("/cgi-sys/formmail.pl", 0, "POST");
    gotoAndPlay("submit");
    }

    Then test your movie (ctrl-enter). Hit the button... you should get something that looks like "name: My Name" in the output window. Let me know what you get.

    My guess is that you are using a pushButton component and trying to attach an on(release) action - which won't work.

    Cheers,
    ZE.

  4. #4
    thanks for the reply...

    I was in fact putting that code on the pushButton component. So I put it on a regular button and I now am taken to the "submit" frame, but I'm still not receiving the email.

    Any ideas?

    I've tried this:

    on (release) {
    subject = "blah";
    recipient = "matt@wakemediagroup.com";
    loadVariablesNum("/cgi-sys/formmail.pl", 0, "POST");
    gotoAndPlay("submit");
    }

    and this:

    on (release) {
    subject = "blah";
    recipient = "matt@wakemediagroup.com";
    getURL("/cgi-sys/formmail.pl", 0, "POST");
    gotoAndPlay("submit");
    }


    what else can I try?

  5. #5
    gskinner.com
    Join Date
    Feb 2002
    Location
    N.America
    Posts
    455
    Try this:

    on (release) {
    subject = "blah";
    recipient = "matt@wakemediagroup.com";
    getURL("/cgi-sys/formmail.pl", "_blank", "POST");
    gotoAndPlay("submit");
    }

    This should open the cgi script in a new window. This way you can see any errors it generates.

    Cheers,
    ZE.

  6. #6
    ok... it says:

    Error: you were unable to send your referring webpage's address, this script resides on a differnet server from the submission form, or you have called this script directly.


    I can get it to work in HTML in the same folder as the swf, and in the fla I'm not calling the script directly. Is this something Flash does? Or is there another way around this?

  7. #7
    gskinner.com
    Join Date
    Feb 2002
    Location
    N.America
    Posts
    455
    Hmm... sounds like it is either expecting you to post your web server address to it, or it requests the reffering url from the header.

    It is most likely the latter. It would do this to keep other people from using the CGI script to send spam.

    If it is the former, you can fix it (could I see the HTML form?). If the latter, it would seem you can't use that script (because apparently Flash does not send appropriate referal information in the header)... perhaps you could install another (if your host allows it).

    ZE.

  8. #8
    here's the html form i tried and it worked. it's the same directory as the swf.

    http://wakemediagroup.com/matt/test/...ver/reach2.htm


    thanks for your help btw

  9. #9
    gskinner.com
    Join Date
    Feb 2002
    Location
    N.America
    Posts
    455
    Yup, it's as I feared - it must be using the referring url to screen posts.

    I think the only real options are;
    1) talk to your host, and see if they can install another formmail script, or disable the security features of this one.

    OR

    2) put an HTML form in a hidden frame, and have your swf call a javascript function that populates the form and submits it.

    Always glad to help. If you get a chance, please sign my guestbook.

    Cheers,
    ZE.

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