A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: contact form with box selection???

  1. #1
    Senior Member
    Join Date
    Jul 2003
    Location
    fort lauderdale
    Posts
    182

    contact form with box selection???

    Hello,

    Im wrapping up a project for this site here:

    http://www.xscapeproductions.com/imageit/

    You will notice in the contact us page under request form, there are boxes beneath the actual form. How do i go about hooking those up so they work with the actual form? Whatever box the user selects should be the subject of the email that will be sent Any help will be greatly appreciated!! I will be using the code that is used in the php form that is available in the flash flas here at flashkit

    http://www.flashkit.com/movies/Scrip...4408/index.php


    thnx in advance!!
    Last edited by seanmee; 09-01-2004 at 10:33 AM.

  2. #2
    Gods cower, women quiver. Buckwheat469's Avatar
    Join Date
    Dec 2003
    Location
    Uranus
    Posts
    247
    After taking a look at the Mailform.php file it seems that you are restricted by what it will send. You can see below what value is the important one that you need to dynamically change...

    Code:
    mail("$adminaddress","Info Request", 
    "FAO: Admin @ $sitename \n
    First Name: $fname 
    Last Name: $lname
    Email: $vemail
    Company: $cname
    Telephone: $telno\n
    The visitor commented:
    Instead of defining "Info Request" as the subject line you should make this dynamic, like $fname and $lname. In your form you can probably make the buttons work as hidden fields or radio buttons. Then when it posts you will have to do a little recoding in the PHP to allow it to use the new variable.
    yup.

  3. #3
    Gods cower, women quiver. Buckwheat469's Avatar
    Join Date
    Dec 2003
    Location
    Uranus
    Posts
    247
    I forgot to mention, your flash is very slow to load on the site, you might want to try to reduce the size a bit. I'm using cable and it took more than 15 seconds to load. For the most part, you want it to load within about 3 seconds, or at least be almost done in 3 seconds. It's a nice site though, good job.
    yup.

  4. #4
    Senior Member
    Join Date
    Jul 2003
    Location
    fort lauderdale
    Posts
    182
    ok i have setup my radio buttons, do i simply give them an instance name and then place some sort of code into the php file? I am completely clueless here do i need to later the code on the flash file as well?

  5. #5
    Gods cower, women quiver. Buckwheat469's Avatar
    Join Date
    Dec 2003
    Location
    Uranus
    Posts
    247
    Change the PHP file a little by adding these values, and follow the examples for the rest of the required variables that are being passed...

    $comments = $_POST["comments"];
    $fname = $_POST["fname"];

    On your Send button within the Flash file you might wanrt to change the script to something like this...
    Code:
    	if ((vemail.indexOf("@") != -1) && (vemail.indexOf(".") != -1) && (length(vemail)>5)) {
    		action = "Send";
    		getURL("mailform.php",_self,"POST");
    		nextFrame();
    Once you do that you will need to somehow make the radio button pass it's variable to the PHP file using the same POST command. I'm not sure how to do this because I don't have my Flash book here to tell me, but the POST command will send all of the variables that you define within your movie, so you can tell the radio button to make a variable true or have a value of 1 when it's selected. Maybe just use 5 different values for 1 variable.

    example code, might not work but will give you an idea...
    Code:
    if(radio1._selected){ radiovariable = "subject 1"; }
    if(radio2._selected){ radiovariable = "subject 2"; }
    PHP Code:
    $radiovariable $_POST['radiovariable']; 
    yup.

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