# One Text Field, One Button, One PHP Script

**URL:** <https://forum.kirupa.com/t/one-text-field-one-button-one-php-script/244678>\
**Category:** programming\
**Created:** [November 20, 2007, 8:40pm UTC](https://forum.kirupa.com/t/one-text-field-one-button-one-php-script/244678 "2007-11-20T20:40:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Multi\_Task](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@Multi\_Task](https://forum.kirupa.com/u/Multi_Task)\
**Post date:** [November 20, 2007, 8:40pm UTC](https://forum.kirupa.com/t/one-text-field-one-button-one-php-script/244678/1 "2007-11-20T20:40:22Z")

</div>

Here is what I am trying to do:

I have an input text field in flash and a button. This text field is for a (“send to a friend”) email that on button release will send a little message to the email provided, i.e. hey [joe@joe.com](mailto:joe@joe.com) check out our site!

The problem is it I can not get the email from input to recieve. Here is my mashed php that I am trying to get to work. FYI I know very little about php. Please advise.

AS:

```auto
 
on (release) {
 if (this.comp.email.text eq "") {
  stop();
 } else {
  loadVariablesNum("email.php", 0, "POST");
  gotoAndPlay(14);
 }
}

```

PHP:

```auto
 
<?php
$sendTo = "To " .$_POST["email"]."<" . $_POST["email"] .">\r";
$subject = "Check Out Our Site";

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

mail($sendTo, $subject, $message, $headers);
print "&success=1&"
?>

```

Also how can I get it to post to not only the email provided from the text field but to also an email for admin?
