# Flash/php Mailform

**URL:** <https://forum.kirupa.com/t/flash-php-mailform/273108>\
**Category:** Uncategorized\
**Created:** [October 11, 2008, 9:58am UTC](https://forum.kirupa.com/t/flash-php-mailform/273108 "2008-10-11T09:58:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrManIsHere](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@mrManIsHere](https://forum.kirupa.com/u/mrManIsHere)\
**Post date:** [October 11, 2008, 9:58am UTC](https://forum.kirupa.com/t/flash-php-mailform/273108/1 "2008-10-11T09:58:11Z")

</div>

I’ve done a mail form for flash. The mail form is the mail.swf, and it pop-up in the flashpage, treesite.swf. Everything works just fine, the mail form is poping up. But when i push the send button it contacts the php-form, send.php. But something is not working at this point, because the onlything that’s being send is From, Mail, Message. That is the headers from the php document.

Im not getting any confirmation either from the mailform, it should go to 10th frame or the 20th if it getting send.

The thing is that have no experience from php, never done a php document before so it’s not that big of a surprise it’s working!

this is the button for the mail pop-up

```php
onClipEvent (enterFrame) {
	if (_root.btn_3, hitTest(_root.head)) {
		_root.createEmptyMovieClip("mail_mc", 65);
		this.loadMovie("mail.swf", "mail_mc") 
		this._x = "230";
		this._y = "190";
		
	} else {
		unloadMovie(_root.mail_mc);
	}
}

```

this is the mail form

```php
stop();

var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();

sender.onRelease = function() {
	senderLoad.theName = theName.text;
	senderLoad.theEmail = theEmail.text;
	senderLoad.theMessage = theMessage.text;
	senderLoad.sendAndLoad("http://www.larsanttila.se/send.php",receiveLoad);
}

receiveLoad.onLoad = function() {
	if(this.sentOk) {
		_root.gotoAndStop("success");
	}
	
	else {
		_root.gotoAndStop("failed");
	}
}

```

and this is the php document

```php
<?PHP

$to = "mail@larsanttila.se";
$subject = "Mail from homepage";
$message = "Name: " . $theName;
$message .= "
Email: " . $theEmail;
$message .= "

Message: " . $theMessage;
$headers = "From: $theEmail";
$headers .= "
Reply-To: $theEmail";

$sentOk = mail($to,$subject,$message,$headers);

echo "sentOk=" . $sentOk;

?>

```
