hey. I am trying to send a bunch of variables from a flash movie to a php script and have that php script email it to me. If anybody has a chance I'd appreciate a look at this code below...
sincerely chad pry
Here is my php
<?php
$headers = "From: $sender\n";
$headers .= "Reply-to: $sender\n";
$headers .= "Content-Type: text/plain; charset=iso-8859-1\n";
$msg = $email\n;
$msg .= $numpages\n;
$msg .= $graphics\n;
$msg .= $products\n;
$msg .= $commerce\n;
$msg .= $merchant\n;
$msg .= $items\n;
$msg .= $hosting\n;
$msg .= $domain\n;
$msg .= $materials\n;
$msg .= $timeframe\n;
$msg .= $phone\n;
$msg .= $company\n;
$msg .= $about\n;
mail($recipient, $subject, $msg, $headers) or die ("Couldn't send mail!");
echo("&sent=done&");
?>
here is my action script..
on (release) {
// Make sure the user filled in all the required fields.
if (name ne "" and email ne "" ) {
// Check to make sure the email address includes and @.
i = "0";
validmail = 0;
while (Number(i)<=Number(length(email))) {
if (substring(email, i, 1) eq "@") {
validmail = 1;
}
i = Number(i)+1;
}
// If there's no @ in the email go to the error page.
if (Number(validmail) == 0) {
gotoAndStop ("error");
} else {
// The line below assumes the script is in the same directory as the HTML page.
subject = "Web Design Form";
recipient = "chad@Advanced-website.com";
products = productsbutton:yesno;
commerce = commercebutton:yesno;
merchant = merchantbutton:yesno;
hosting = hostingbutton:yesno;
domain = domainbutton:yesno;
materials = materialsbutton:yesno;
loadVariablesNum ("webdesign.php", 0, "POST");
play ();
}
} else {
// if the user left required fields blank, show them an error message.
gotoAndPlay ("error");
}
}