Jump to content

Flash data to PHP


POMO-man

Recommended Posts

I'm using a web form designed in Flash to send RSVP details for an event we're hosting to our coordinator via email. The SWF file can be seen here:www.promiseweek.com/rsvp.htmlIn the Flash file there are three form fields that have a "var" assigned to them and it is this "var" data that the actionscript is sending to PHP when the "SEND" button is clicked in the form. Another designer built this form in Flash and the accompanying PHP form. I have modified both the Flash file and the PHP to allow for a drop-down menu (in the form of a flash combo box component) that allows those wanting to RSVP for an event to choose one of the three events from the drop down menu. I have given the combo box an instance name of "meetingmenu" but could not find how to give it a "var" so that the PHP form will send the data that is selected in the combo box along with the other form data in the body of the email. The rest of the form works properly. I just need to figure out how to get the data from the combo box sent properly to the PHP form. I tried to use the cmbo box instance name of "meetingmenu" as you will see in the PHP below... but that is not working.The PHP is below. Thanks for any help you can offer...

<?php/***************************************************\ * PHP 4.1.0+ version of email script. For more * information on the mail() function for PHP, see * [url="http://www.php.net/manual/en/function.mail.php"]http://www.php.net/manual/en/function.mail.php[/url]\***************************************************/// First, set up some variables to serve you in// getting an email.  This includes the email this is// sent to (yours) and what the subject of this email// should be.  It's a good idea to choose your own// subject instead of allowing the user to.  This will// help prevent spam filters from snatching this email// out from under your nose when something unusual is put.$sendTo = "bobbiel@lamcreative.com";$subject = "Promise Week RSVP";// variables are sent to this PHP page through// the POST method.  $_POST is a global associative array// of variables passed through this method.  From that, we// can get the values sent to this page from Flash and// assign them to appropriate variables which can be used// in the PHP mail() function.// header information not including sendTo and Subject// these all go in one variable.  First, include From:$headers = "From: " . $_POST["name"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n";// next include a replyto$headers .= "Reply-To: " . $_POST["email"] . "\r\n";// often email servers won't allow emails to be sent to// domains other than their own.  The return path here will// often lift that restriction so, for instance, you could send// email to a hotmail account. (hosting provider settings may vary)// technically bounced email is supposed to go to the return-path email$headers .= "Return-path: " . $_POST["email"];// now we can add the content of the message to a body variable$message = $_POST["message"];$meetingmenu = $_POST["meetingmenu"];// once the variables have been defined, they can be included// in the mail function call which will send you an emailmail($sendTo, $subject, $message, $headers);?>

Link to comment
Share on other sites

This isn't a PHP issue, it's a Flash issue. Check the Flash documentation to see how to get the value from a combobox component. It probably has a value property or something that you need to access, I just haven't used it before so I'm not sure off the top of my head. Add some code into the form submission part that will read the value from the combobox and include it in the request to the PHP script.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...