all groups > flash actionscript > september 2005 >
You're in the

flash actionscript

group:

Need Help Using flash + PHP to send email!


Need Help Using flash + PHP to send email! seanhaddy
9/10/2005 5:49:11 PM
flash actionscript:
Ok, the topic pretty much explains what I need help with... I have an email
form with a bunch of fields, and I want, when a person presses the submit
button, for it to post to php file, then php file to then send the mail to
email.

Thanks very much!

Here is the code I have:

// in the flash file, in the mc containing the form fields (more used, just
kept these to simplify)
var namev:String = name_txt.text;
var numberv:String = number_txt.text;
var emailv:String = email_txt.text;
var imnamev:String = imname_txt.text;

//in the _parent clip (also _root)

// submit button
on(release) {
form.loadVariables("email.php", "POST");
}

//on the form mc, basically covers the form upon reciving data submit info
from server
onClipEvent(data){
thankyou_mc._visible = true;
}

//here is the code written in the php file on the server that should respond
on post (I may have written the message area wrong

<?php
$sendTo = "info@customsig.com";
$subject = "Design Request Submission";

$headers = "From: " . $_POST["namev"];
$headers .= "<" . $_POST["emailv"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["emailv"] . "\r\n";
$headers .= "Return-Path: " . $_POST["emailv"];
$message = "From: " $_POST["namev"] . "\r\n" . "Email Address: "
$_POST["emailv"] . "\r\n" . "Phone Number: " $_POST["numberv"] . "\r\n" .
"Instant Messenger Used: " $_POST["imnamev"] . "\r\n" ;

mail($sendTo, $subject, $message, $headers);
?>
Re: Need Help Using flash + PHP to send email! seanhaddy
9/10/2005 7:05:20 PM
AddThis Social Bookmark Button