Flash email form

hey, hopefully one of u kind people at Kirupa.com will be able to help me out with the email form but you will have to bare with me cuz i’m not that advanced with flash yet (i’m only 15!). i am making a web site for my dad and i have managed to get the basics in there with all the fields needed, a cancel button and also a submit button which cannot be pressed until all of the fields have been filled in. i have got to the point where you click the submit button but nothing is happening. on the button i have added this script to load the php file:

[SIZE=1]on (release) {
sender_mail = _root.Semail.text
sender_name = _root.Sname.text
sender_subject = _root.Ssubject.text
sender_message = _root.Smessage.text
loadVariables(“sendmail.php”,“POST”);
this.onData = function()
{
for(var a in this) trace([a,this[a]])
_root.nextFrame();
if(this.output==‘sent’)
{
_root.errTitle = ‘Thank You.’;
_root.errType = “Your message has been sent.”;
} else {
_root.errTitle = “Error!”;
_root.errType = “Attention, an error occurred while processing your message. Please try again later.”;
}
}
} [/SIZE]

I can’t see anything wrong with this and not being to familier with .php i think the error may be in this script:

[SIZE=1]<?
if(!empty($HTTP_POST_VARS[‘sender_mail’]) || !empty($HTTP_POST_VARS[‘sender_message’]) || !empty($HTTP_POST_VARS[‘sender_subject’]) || !empty($HTTP_POST_VARS[‘sender_name’]))
{
$sendTo = “[email protected]”;
$subject = stripslashes($HTTP_POST_VARS[‘sender_subject’]);
$body = stripslashes($HTTP_POST_VARS[‘sender_message’]);
$body .= "


";
$body .= “Mail sent by: " . $HTTP_POST_VARS[‘sender_name’] . " <” . $HTTP_POST_VARS[‘sender_mail’] . ">
";
$header = “From: " . $HTTP_POST_VARS[‘sender_name’] . " <” . $HTTP_POST_VARS[‘sender_mail’] . ">
";
$header .= “Reply-To: " . $HTTP_POST_VARS[‘sender_name’] . " <” . $HTTP_POST_VARS[‘sender_mail’] . ">
";
$header .= “X-Mailer: PHP/” . phpversion() . "
";
$header .= “X-Priority: 1”;
if(@mail($to, $subject, $body, $header))
{
echo “output=sent”;
} else {
echo “output=error”;
}
} else {
echo “output=error”;
}
?> [/SIZE]

hopefully i havn’t bombarded you with too much info at once but i’m getting pretty desparate for help now. thank you in advance any help is much appreachiated.

Hi, try using getURL in flash rather than loadVariables - I think this will solve some of the problems.

To get PHP to mail out is simple the code you need is as follows:

mail ($MAIL , $REPLY , $MESSAGE);

you shouldn’t need to use the http_post stuff either whilst you’re testing it to make things look more simple.

Hope this helps

?>

nah that doesn’t work it just brings up the .php file and nothing more…
:h: