# Flash email form

**URL:** <https://forum.kirupa.com/t/flash-email-form/59745>\
**Category:** flash\
**Created:** [August 3, 2004, 2:54pm UTC](https://forum.kirupa.com/t/flash-email-form/59745 "2004-08-03T14:54:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jetski](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@Jetski](https://forum.kirupa.com/u/Jetski)\
**Post date:** [August 3, 2004, 2:54pm UTC](https://forum.kirupa.com/t/flash-email-form/59745/1 "2004-08-03T14:54:30Z")

</div>

hey, hopefully one of u kind people at [Kirupa.com](http://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 = “paul@proservices.info”;  
$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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 3, 2004, 3:34pm UTC](https://forum.kirupa.com/t/flash-email-form/59745/2 "2004-08-03T15:34:42Z")

</div>

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

?\>

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 3, 2004, 9:00pm UTC](https://forum.kirupa.com/t/flash-email-form/59745/3 "2004-08-03T21:00:17Z")

</div>

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