# Can't send data to php

**URL:** <https://forum.kirupa.com/t/cant-send-data-to-php/285029>\
**Category:** flash\
**Created:** [March 26, 2009, 10:20am UTC](https://forum.kirupa.com/t/cant-send-data-to-php/285029 "2009-03-26T10:20:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxelcat](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/maxelcat/32/2854_2.png) [@maxelcat](https://forum.kirupa.com/u/maxelcat)\
**Post date:** [March 26, 2009, 10:20am UTC](https://forum.kirupa.com/t/cant-send-data-to-php/285029/1 "2009-03-26T10:20:30Z")

</div>

I am trying to finish get a form to send an email. I have read/studied the lesson on this site, but still have a problem.

I have mc called formTest. On frame 1 inside I have the following AS - I have removed all formatting script. I create the text fields dynamically

```auto
stop();
var senderMessage:String;
var fieldNames:Array = new Array("fullName","phone","email","ask");
for (var i:Number=0;i<4;i++){
 this.createTextField(fieldNames*,this.getNextHighestDepth(),100,10+i*30,200,22);
 if (i==0){
 
 ... formatting
  }
 ... formatting
 }
  ...formatti9ng
}
 

```

This movie clip is then put onto the main time line, frame 1 of which has this as

```auto

testForm.sendEmail_btn.onRelease = function():Void{
  message = testForm.ask.text;
  testForm.loadVariables("sendmail.php", "POST");
  trace (message); //produces what ever is typed into the box message
}

```

sendmail.php looks like this:

```auto

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<h1>Hello</h1>
<?php 
 
echo 'You are in the sendmail.php file';
 
$sendTo = "[EMAIL="edward@ee-web.co.uk"]...[/EMAIL]";
$subject = "My Flash site reply";
$headers = "From: [EMAIL="edward@eldon.gotadsl.co.uk"]...[/EMAIL]";
//fullName","phone","email","ask
$message = 'here is the message';
$message .= $_POST["message"];
mail($sendTo, $subject, $message, $headers);
?>
</body>
</html>

```

When the send button is pressed an email is delivered, but $\_POST[‘message’] appears to be empty.

I have put

```auto

onClipEvent(data){ 
   trace("message="+message); 
} 

```

onto the mc formTest. This prints out “message=undefined”

I am doing something wrong with sending the varaibles from the form.

Could someone please help me see what!

Thanks

E
