all groups > flash (macromedia) > june 2007 >
You're in the

flash (macromedia)

group:

Flash Form using PHP (combobox trouble)


Flash Form using PHP (combobox trouble) j-paintrain
6/14/2007 8:32:07 PM
flash (macromedia):
I'm using a tutorial on Flash-Based Email Form Using PHP but I'm having trouble
with ComboBoxes.

Can anyone familiar with this tutorial give me a hand?

Here's the low-down.

I want to pass a variable from a ComboBox to my PHP script - and I'm not sure
how to do it.
Re: Flash Form using PHP (combobox trouble) dzedward
6/14/2007 8:36:56 PM
you refer to the selected item in a comboBox by using
Re: Flash Form using PHP (combobox trouble) j-paintrain
6/14/2007 8:56:43 PM
Would you mind giving me an example in AS? (the instance name for my comboBox is "hearabout")
Re: Flash Form using PHP (combobox trouble) dzedward
6/14/2007 9:25:03 PM
i would put a dynamic text field on stage give it instance name of whatever,
for this example, my_txt. also, give it variable name of whatever, in this
example, txt
my_txt.text = comboboxinstancename.value;

sendForm = function () {
dataSender = new LoadVars();
dataSender.txt = whatever; //whatever is how PHP grabs it.
}
or whatever your sending method is.
you can make this dynamic text field have no border and make the text color
same as background if you dont want the user to be able to see it. this is a
vague example but should get your head on the right track. you dont have to
use sendForm, plug it into whatever method you are using. its basically
showing you that youre making the dynamic text field display what is selected
in the comboBox, then youre sending the info from the dynamic text field to PHP.
Re: Flash Form using PHP (combobox trouble) j-paintrain
6/15/2007 3:56:43 PM
That information certainly helps. I think I've made progress. I now can't get
value to pass to the PHP script.

Can you (or another person with grace) look at
http://www.medialinkweb.com/shared/combobox-help.fla here.

Here is my PHP script:


<?php

$to = "test@test.com";
$subject = "email subject";
$email_headers = "Content-type: text/html\n";


$email_headers .= "From: address@test.com\nReturn-Path: address@test.com\n";

$body = "

<html>
<head>
<style type=\"text/css\">
body, b {
font-size:10px;
font-family: Arial;
color:#000000;
}

</style>
</head>
<body>
<b>Name:</b> $name<br><br>

<b>Address:</b> $address<br><br>

<b>City:</b> $city<br><br>

<b>State:</b> $state<br><br>

<b>Zip:</b> $zip<br><br>

<b>Phone:</b> $phone<br><br>

<b>Email Address:</b> $email<br><br>

<b>Amount:</b> $cash<br><br>

<b>How I heard about you:</b> $Myvar<br><br>

</body>
</html>";

mail($to, $subject, $body, $email_headers);


?>
AddThis Social Bookmark Button