Feed Me

Icon

Seth Taylor Graphic Design

Flash Check Box PHP and Form Mail

Free Flash File

A while ago (when I was developing a portion of a site for Fort Knox) I needed some help on filling out a form in Flash and sending it to PHP. Almost all of my variables were text variables. But I had a few check boxes in the form. I didn’t know how to properly pass checkbox variables to PHP. I looked for help but couldn’t find it anywhere. After finally piecing together various tutorials I successfully completed the form. I’m sure this is second nature for some people. But it wasn’t for me. I commited to help someone else by demonstrating how to make the form. So here are the files necessary for a Flash form using check boxes.

Download Free Flash File Form with PHP and Check Box

Category: Flash, Free, PHP, Uncategorized

Tagged:

9 Responses

  1. frankencio says:

    hello
    I have just send an email but i couldnt see if it was sended successfully,

    ok I downloaded the Flash Check Box PHP and Form Mail tutorial and its great.
    i need to insert some other items
    ill need it like this:

    Name:
    Email:
    Telephone:
    company:

    product1 Lowfat__ Traditional__ Coffe flavor___
    product2 Lowfat__ Traditional__ Coffe flavor___
    product3 Lowfat__ Traditional__ Coffe flavor___

    and so on…

    send(btn) clear(btn)

    thanks a lot and i apologize for my english, i hope being clear
    i apreciate your attention

    sincerely,

    Carlos Andrés Bonilla

  2. avocado says:

    Hi Seth

    This is brilliant, i’ve been scratching my head for days trying to work this out.

    I have a request though, i’m just starting to get into actionscripting and php and i need to make the additional fields like Carlos, would it be possible to see a sample source of how to create the other fields to work with php?

    Many thanks

    Richard Hau.

  3. avocado says:

    i just noticed that the variables for the check boxes aren’t sending. i tested the files without modifying them on my server and the email comes through though with no variables just the titles. any ideas?

  4. Seth Taylor says:

    To avocado:

    Thanks for the comment about the variables not sending.
    I apologize for not getting back to your excellent request. (I rarely check my comments because they so often are spammed.)

    I just tested the script by re-uploading it on another server and it is working well.
    On a few servers I’ve had variables that don’t get sent though to my inbox because the server’s ‘global variables’ are not correctly set. A quick call to the hosting provider often solves the problem. Sometimes they’ll blame the .swf or say “Flash doesn’t work with PHP” but, be patient and it will get resolved.
    I’ll post some updated Flash Files to show how additional fields are inserted.

  5. Robert says:

    Hi Seth,

    I’m having the same problem as ‘avocado’ had (a while back =) )

    I’ve been trying to get checkboxes and PHP work for about a week now, and this is really getting on my nerves =)

    I can, through the controlpanel at my webhotel change the ‘Register Globals’ to either on/off. By default they’re set to off. Is this what you mean by the ISP’s global variables not being set correctly? Or what should I ask them to do to make it work properly? I just really don’t know what to ask of them.

    Regards,
    Robert

  6. Robert says:

    Sorry to bother you! What I mentioned in my earlier post about ‘Register Globals’ at my ISP’s controlpanel. That was it!

    The reason it didn’t work for a few days was that they were migrating my serverspace atm. =D

    Your script worked perfectly!! Thank you, it has helped me so much!

    Regards,
    Robert

  7. Seth says:

    Robert, I’m glad it worked for you! Thanks for your kind words.

  8. Edgeloop says:

    Hi Seth,

    I found your site with your solution to this CB problem. It works really good!
    But I wonder if you did post additional files on how to insert textfields in both the flash and in the PHP?

    I bet this is really easy for you, but I’ve been scratching my head over this since three weeks back and can’t get my head around it =)

    But the CB’s work really well, just not when I insert textfields.

    thanks,
    Samuel

  9. Edgeloop says:

    I got everything working except that the textfields come out as ‘undefined’ in the mail I get.

    In the flashfile I have:

    ———————————————————————
    var senderLoad:LoadVars = new LoadVars();
    var receiveLoad:LoadVars = new LoadVars();

    _root.sender.onRelease = function() {

    senderLoad.sName = _root.name_txt.text;
    senderLoad.sEmail = _root.email_txt.text;
    senderLoad.sBusiness = _root.business_txt.text;

    if (_root.cb_a.selected == true) {
    senderLoad.a = “[ X ]“;
    } else {
    senderLoad.a = “[ ]“;
    }
    if (_root.cb_b.selected == true) {
    senderLoad.b = “[ X ]“;
    } else {
    senderLoad.b = “[ ]“;
    }
    if (_root.cb_c.selected == true) {
    senderLoad.c = “[ X ]“;
    } else {
    senderLoad.c = “[ ]“;
    }
    if (_root.cb_d.selected == true) {
    senderLoad.d = “[ X ]“;
    } else {
    senderLoad.d = “[ ]“;
    }

    senderLoad.sendAndLoad(“send.php”, receiveLoad);
    };
    receiveLoad.onLoad = function() {
    if (this.sentOk) {
    _root.gotoAndStop(“sent”);
    } else {
    _root.gotoAndStop(“not_sent”);
    }
    };
    stop();
    ———————————————————————

    And in the PHP I have:

    ———————————————————————
    $<?PHP
    $to = "myemail@mail.com";
    $subject = "My subject!";
    $message .= "\n—————————————————";
    $message .= "\nFrom: " . $sName;
    $message .= "\nMailadress: " . $sEmail;
    $message .= "\n\nBusiness: " . $sBusiness;
    $message .= "\n\nThings:";
    $message .= "\nThingie A: " . $a;
    $message .= "\nThingie B: " . $b;
    $message .= "\nThingie C: " . $c;
    $message .= "\nThingie D: " . $d;
    $message .= "\n—————————————————";

    $sentOk = mail($to,$subject,$message);
    echo "sentOk=" . $sentOk;
    ———————————————————————

    What am I doing wrong? I would be so grateful fo some pointers at least.

    thanks,
    Samuel

Leave a Reply