PDA

View Full Version : Flash scripting help


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

Leifde
20th December 2005, 21:12
Random guess here - does the button have doSubmit or doSubmit() ?

keiran
20th December 2005, 21:17
Well the click handle of the button is 'doSumbit' if thats what you mean

Keiran

tristancliffe
20th December 2005, 21:58
Sumbit or Submit?

keiran
20th December 2005, 22:54
Doh!! It's always something stupid like that. Thats probaly the problem will test it out tomorrow :)

*me searches for delete button to hide evidence of stupidity :schwitz::pillepall:D*

Keiran