all groups > flash data integration > march 2007 >
You're in the

flash data integration

group:

Issue: Flash radio buttons & Php form


Issue: Flash radio buttons & Php form Lutrell
3/16/2007 2:28:03 PM
flash data integration: I have a flash form which all of the fields are sending correctly
through the php code. The flash radio buttons I added with the
[B]groupname == topic[/B], doesnt send with the rest of the
information that is being sent to the email. My question is how do I get
the flash radio button info to submit with the rest of the form.


[B]The code for the send button on my flash file:[/B]

on (release) {
// send variables in form movieclip (the textfields)
// to email PHP page which will send the mail
form.loadVariables("form.php", "POST");
}

===============================================
===============================================


[B]Form.php:[/B]

<?php
$to = "Contactus@test.com";
$subject = "Contact Page Information for Today";


$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-Path: " . $_POST["email"];

$message .= "\n\n";
$message .= "Subject: " . $_POST["topic"] . "\r\n";
$message .= "Email: " . $_POST["email"] . "\r\n";
$message .= "Name: " . $_POST["name"] . "\r\n";
$message .= "Address: " . $_POST["address"] . "\r\n";
$message .= "City: " . $_POST["city"] . "\r\n";
$message .= "State: " . $_POST["state"] . "\r\n";
$message .= "Zip Code: " . $_POST["zip"] . "\r\n";
$message .= "Phone: " . $_POST["phone"] . "\r\n\n";
$message .= "Message: " . $_POST["message"] . "\r\n";

mail($to, $subject, $message, $headers);
?>[b]Text[/b]
Re: Issue: Flash radio buttons & Php form MotionMaker
3/18/2007 3:11:15 PM
I believe loadVariables will only pickup variables in the form level. You are
probably using the http://livedocs.macromedia.com/flash/8/main/00002791.html
and is why loadVariables is sending the TextFields.

What you need to do with the radio buttons is to get the data out of them into
variables on the Form timeline.

Look at http://livedocs.macromedia.com/flash/8/main/00003923.html

/*Assumes code in in Form timeline
The group topic renamed to topic_rg
A new variable is defined as topic.

*/

var topic;
var listenerObject:Object = new Object();
listenerObject.click = function(eventObj:Object) {
topic = evt_obj.target.selection.data;
};
topic_rg.addEventListener("click", listenerObject);
Re: Issue: Flash radio buttons & Php form Lutrell
3/19/2007 6:25:09 PM
Do you mean like this:

<?php
*/
var topic;
var listenerObject:Object = new Object();
listenerObject.click = function(eventObj:Object) {
topic = eventObj.target.data;
trace(topic)
};
groupTopic1_rb.addEventListener("click", listenerObject);
groupTopic2_rb.addEventListener("click", listenerObject);
groupTopic3_rb.addEventListener("click", listenerObject);
groupTopic4_rb.addEventListener("click", listenerObject);
groupTopic5_rb.addEventListener("click", listenerObject);
groupTopic6_rb.addEventListener("click", listenerObject);
groupTopic7_rb.addEventListener("click", listenerObject);
groupTopic8_rb.addEventListener("click", listenerObject);
groupTopic9_rb.addEventListener("click", listenerObject);
groupTopic10_rb.addEventListener("click", listenerObject);
groupTopic11_rb.addEventListener("click", listenerObject);
groupTopic12_rb.addEventListener("click", listenerObject);
groupTopic13_rb.addEventListener("click", listenerObject);
groupTopic14_rb.addEventListener("click", listenerObject);

$to = "Contactus@hopetodaymagazine.com";
$subject = "Contact Page Information for Hope Today";


$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-Path: " . $_POST["email"];

$message .= "\n\n";
$message .= "Subject: " . $_POST["topic"] . "\r\n";
$message .= "Email: " . $_POST["email"] . "\r\n";
$message .= "Name: " . $_POST["name"] . "\r\n";
$message .= "Address: " . $_POST["address"] . "\r\n";
$message .= "City: " . $_POST["city"] . "\r\n";
$message .= "State: " . $_POST["state"] . "\r\n";
$message .= "Zip Code: " . $_POST["zip"] . "\r\n";
$message .= "Phone: " . $_POST["phone"] . "\r\n\n";
$message .= "Message: " . $_POST["message"] . "\r\n";

mail($to, $subject, $message, $headers);
?>



Re: Issue: Flash radio buttons & Php form MotionMaker
3/19/2007 11:31:37 PM
AddThis Social Bookmark Button