I am building a flash contact form for a site and then i want to use the mail() php class to send the mail.
This is the actionscript for the send button says:
Code: Select all
on (release) {
var myVars:LoadVars = new LoadVars();
myVars.firstName = firstName.text;
myVars.lastName = lastName.text;
myVars.emailAddress = emailAddress.text;
myVars.region = region.label;
myVars.plzDirect = plzDirect.label;
myVars.theMessage = theMessage.text;
myVars.httpLink = httpLink.text;
myVars.tcAccept = tcAccept.selected;
myVars.sendAndLoad("form.php", myVars,"POST");
gotoAndStop (2);
}
Code: Select all
<?php
$firstName = $_POST['firstName'];
$lastName = $_POST['lastName'];
$emailAddress = $_POST['emailAddress'];
$region = $_POST['region'];
$plzDirect = $_POST['plzDirect'];
$theMessage = $_POST['theMessage'];
$httpLink = $_POST['httpLink'];
// Email will go here
$recipient = 'ruark@rubiksroom.com';
//subject duh!
$subject = 'New form submission from TRR site';
// headers & content
$headers = 'Content-type: text/html; charset=iso-8859-1';
$content = "<html><head><title>Contact Details</title></head><body><br />";
$content .= "First Name: <b>" . $firstName . "</b><br />";
$content .= "Last Name: <b>" . $lastName . "</b><br />";
$content .= "Email: <b>" . $emailAddress . "</b><br />";
$content .= "Dept: <b>" . $plzDirect . "</b><br /><hr /><br />";
$content .= $theMessage . "<br>";
$content .= $httpLink;
$content .= "<br /></body>";
// The mail() function allows you to send mail.
mail($recipient,$subject,$content,$headers);
?>