I suggest using some simple PHP.
The easiest way to takcle this is using loadVars. loadVars is specifficaly made for this kind of application - sending to server side scripts.
From your website, it looks like you have everything already bulit.
Here is what you would do to send back/forth to the PHP:
1) For the actionscript below to work, change your instance names to:
Code:
theName // name input field
theEmail // email input field
theMessage // message txt area
sender // submit button
2) Add the following actionscript to the controlling frame.
Code:
stop();
var senderLoad:LoadVars = new LoadVars(); // loadVars variable to send data
var recieveLoad:LoadVars = new LoadVars(); // loadVars variable to recieve data
sender.onRelease = function() { // when you hit the send button
senderLoad.theName = theName.text; // creates variable for the name field
senderLoad.theEmail = theEmail.text; // this is for the email field
senderLoad.theMessage = theMessage.text; // and the message
senderLoad.sendAndLoad("http://www.domain.com/send.php",recieveLoad); // change the URL to your php script
}
receiveLoad.onLoad = function() { // data that comes back from the PHP
if(this.sentOk) { // if the message was successful
theMessage.text = "Success"
}
else { // if the message did not send
theMessage.text = "Failure"
}
}
And here is the simple PHP script.
PHP Code:
<?PHP
$to = "youremail@domain.com"; // add your email address
$subject = "Website Contact Form";
$message = "Name: " . $theName;
$message .= "\nEmail: " . $theEmail;
$message .= "\n\nMessage: " . $theMessage;
$headers = "From: $theEmail";
$headers .= "\nReply-To: $theEmail";
$sentOk = mail($to,$subject,$message,$headers);
echo "sentOk=" . $sentOk; // sends back a boolean value based on the success of the script
?>
Bookmarks