This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Flash Site Design > September 2005 > Need Help Using flash + PHP to send email!





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Need Help Using flash + PHP to send email!
seanhaddy

2005-09-10, 7:22 pm

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);
?>

dreamx.0

2005-09-11, 4:14 am

I can help you, for everything contact me at jrbomani@bomanionline.com

dreamx.0
seanhaddy

2005-09-15, 4:22 am

I still need help with this... dreamx tried, but could not figure it out.... PLEASE HELP!!! THANKS!!!
gacko

2005-09-15, 7:30 pm

here's a PHP file I using, succsefully:
<?php
$ToEmail = "whatever@whatevercom";
##$ToName = "whoever whatever";
$ToSubject = "Example Mail - boarding form - $owner_name owner of pet:
$pet_name";

$EmailBody = "
boarding form, Date: $dateTextField\n
-----------------------------------
Pet's name: $pet_name\n
Owner's name: $owner_name\n
Boarding from: $start_date\nUntil: $end_date\n
Does the pet require medication or have any special health issues?:
$health_issues_send\n
Does your pet require a special diet? $sp_diet_send\n
Feeding directions: $feed_direct_send\n
Does your pet require special handling or have special needs?
$speical_needs_send\n
Would you like V.I.P. care for your pet at an additional charge?
$VIP_aaprove_send\n
Would you like an extended condo for your cat at an additional charge?
$condo_approve_send\n
Procedures to be done while your pet is with us: $sp_proc_approve_send\n
Emergency contact name/phone: $emergency_name_send\n";
$EmailFooter="\nThis message was sent by: $owner_name from Animal Hospital
of Factoria web site. If you feel that you recieved this e-mail by accident
please contact us at ...";
$Message = $EmailBody.$EmailFooter;
mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$owner_name."
<".$ToEmail.">");
Print "_root.EmailStatus=Complete - Your mail has been sent";
?>


on the flash side:
loadVariablesNum("newCustomer.php", "1", "POST");

good lock!

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews