Okay, I'm a total newbie, so lets get that out of the way. I'm doing a website for someone and thanks to gotoandlearn.com I have successfully created a popup page for the user to enter the usual name/email/phone information, along with a choice between two radio buttons, and then select one or more check boxes. The idea behind the page is for the user to provide their contact information and to select the topics they would like to receive more information about. Here is the Flash script:
stop();
var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();
sender.onRelease = function() {
senderLoad.name = name.text;
senderLoad.email = email.text;
senderLoad.phone = phone.text;
senderLoad.address = address.text;
senderLoad.radioGroup = radioGroup;
senderLoad.hsdip = hsdip.text;
senderLoad.tutoring = tutoring.text;
senderLoad.learnlife = learnlife.text;
senderLoad.SpecNeeds = SpecNeeds.text;
senderLoad.CollegeSurvive = CollegeSurvive.text;
senderLoad.Talent = Talent.text;
senderLoad.CareerAdvise = CareerAdvise.text;
senderLoad.ComService = ComService.text;
senderLoad.FridayClub = FridayClub.text;
senderLoad.sendAndLoad("http://www.uc-academy.com/send.php",receiveLoad);
}
receiveLoad.onLoad = function() {
if(this.sentOk) {
_root.gotoAndStop("success");
}
else {
_root.gotoAndStop("failed");
}
}
-
-
- stop();
-
- var senderLoad:LoadVars = new LoadVars();
- var receiveLoad:LoadVars = new LoadVars();
-
- sender.onRelease = function() {
- senderLoad.name = name.text;
- senderLoad.email = email.text;
- senderLoad.phone = phone.text;
- senderLoad.address = address.text;
- senderLoad.radioGroup = radioGroup;
- senderLoad.hsdip = hsdip.text;
- senderLoad.tutoring = tutoring.text;
- senderLoad.learnlife = learnlife.text;
- senderLoad.SpecNeeds = SpecNeeds.text;
- senderLoad.CollegeSurvive = CollegeSurvive.text;
- senderLoad.Talent = Talent.text;
- senderLoad.CareerAdvise = CareerAdvise.text;
- senderLoad.ComService = ComService.text;
- senderLoad.FridayClub = FridayClub.text;
- senderLoad.sendAndLoad("http://www.uc-academy.com/send.php",receiveLoad);
- }
-
- receiveLoad.onLoad = function() {
- if(this.sentOk) {
- _root.gotoAndStop("success");
- }
- else {
- _root.gotoAndStop("failed");
- }
- }
-
The PHP script is incomplete and looks like this:
<?PHP
$to = "mymail@mymail.com";
$subject = "Request for Information";
$message = "Name: " . $name;
$message .= "E-Mail: " . $email;
$message .= "Phone number: " . $phone;
$message .= "Mailing address: " . $address;
$message .= "Please contact me via: " . $radioGroup;
$headers = "From: $email";
$headers .= "\nReply To: $email";
mail($to,$subject,$message,$headers);
?>
-
-
- <?PHP
-
- $to = "mymail@mymail.com";
- $subject = "Request for Information";
- $message = "Name: " . $name;
- $message .= "E-Mail: " . $email;
- $message .= "Phone number: " . $phone;
- $message .= "Mailing address: " . $address;
- $message .= "Please contact me via: " . $radioGroup;
-
- $headers = "From: $email";
- $headers .= "\nReply To: $email";
-
- mail($to,$subject,$message,$headers);
-
- ?>
-
-
-
1. Firstly, have I handled the radio buttons correctly? They are labelled differently but both belong to radioGroup
2. How do I code the PHP to pull information from the various check boxes (assuming I've done these correctly in the Flash script i.e. the entries following the radioGroup entry)
3. Finally, I don't understand how the PHP sends the email. Do I need to associate the PHP file with a Server side file or does the PHP script just compose and send an email based on the to/from information sent to it from the Flash script?
Thanks for your patience and thanks for your help.