I'm using flash mx to create my website and using the action script to send data to a php file. Although I can't get it to work and don't understand why it won't work :s Anyone know whats wrong with it ??
This is the code on the Frame which the contact page is located
The push button has the click handle 'doSumbit'
The php file called contact.php has the following code
Thanks
Keiran
This is the code on the Frame which the contact page is located
<?php
function doSubmit()
{
userData = new LoadVars();
userData.name = name;
userData.email = email;
userData.message = message;
userData.send("contact.php", "", "POST");
}
?>
The php file called contact.php has the following code
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$recipient = "[email protected]";
$subject = "Crazy Custard - Contact";
$mailheader = "From: $name\n";
$mailheader .= "Reply-To: $email\n\n";
$message = "Sender's name: $name\n";
$message .= "Sender's message: $message\n\n";
mail($recipient, $subject, $message, $mailheader) or die ("Failure");
?>
Keiran