keiran
20th December 2005, 20:07
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
function doSubmit()
{
userData = new LoadVars();
userData.name = name;
userData.email = email;
userData.message = message;
userData.send("contact.php", "", "POST");
}
The push button has the click handle 'doSumbit'
The php file called contact.php has the following code
<?
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$recipient = "keiran.smart@gmail.com";
$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");
?>
Thanks
Keiran
This is the code on the Frame which the contact page is located
function doSubmit()
{
userData = new LoadVars();
userData.name = name;
userData.email = email;
userData.message = message;
userData.send("contact.php", "", "POST");
}
The push button has the click handle 'doSumbit'
The php file called contact.php has the following code
<?
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$recipient = "keiran.smart@gmail.com";
$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");
?>
Thanks
Keiran