# \[F8\] Components contact form - Help needed please

**URL:** https://forum.kirupa.com/t/f8-components-contact-form-help-needed-please/177906
**Category:** flash
**Created:** [February 6, 2006, 1:45pm UTC](https://forum.kirupa.com/t/f8-components-contact-form-help-needed-please/177906 "2006-02-06T13:45:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![drake\_place](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@drake\_place](https://forum.kirupa.com/u/drake_place)
#### Post date: [February 6, 2006, 1:45pm UTC](https://forum.kirupa.com/t/f8-components-contact-form-help-needed-please/177906/1 "2006-02-06T13:45:49Z")

</div>

Hi,  
I’m quite new at scripting with components and I’m trying to create a simple email contact form using Flash 8 and PHP…

[http://www.drake-place.co.uk/contactform.html](http://www.drake-place.co.uk/contactform.html)

However, when I click submit (with the fields filled in), the form contacts the PHP and sends a blank email to my address. Can someone please help me set it so that my textfields data is sent to the PHP and then sends an email to my address? I have tried everything I know so far, and I am now at a loss.

The ActionScript I am using is:

```auto
stop();
yourname = _root.form_mc.name_ti.text;
youremail = _root.form_mc.email_ti.text;
yourcomments = _root.form_mc.message_ti.text;

var submit_pbListener:Object = new Object();
submit_pbListener.click = function () {
    _root.loadVariables("http://www.drake-place.co.uk/email2.php", "POST");
};
submit_pb.addEventListener ("click", submit_pbListener);

var reset_pbListener:Object = new Object();
reset_pbListener.click = function () {
    form_mc.name_ti.text = "";
    form_mc.email_ti.text = "";
    form_mc.message_ti.text = "";
};
reset_pb.addEventListener ("click", reset_pbListener);

```

and the PHP code is:

```auto
<?php
$sendTo = "nathan@drake-place.co.uk";
$subject = "Drake-place response";

$headers = "From: " . $_POST["yourname"] ." <" . $_POST["youremail"] .">
";

$headers .= "Reply-To: " . $_POST["youremail"] . "
";
$headers .= "Return-path: " . $_POST["youremail"];

$message = $_POST["yourcomments"];
mail($sendTo, $subject, $message, $headers);

?>

```

I hope someone can tell me where I’m going wrong  
Thanks
