# Flash PHP - Email

**URL:** <https://forum.kirupa.com/t/flash-php-email/172676>\
**Category:** flash\
**Created:** [December 16, 2005, 7:37pm UTC](https://forum.kirupa.com/t/flash-php-email/172676 "2005-12-16T19:37:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjaworsk1](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@sjaworsk1](https://forum.kirupa.com/u/sjaworsk1)\
**Post date:** [December 16, 2005, 7:37pm UTC](https://forum.kirupa.com/t/flash-php-email/172676/1 "2005-12-16T19:37:32Z")

</div>

I created a form on my site using component boxes and i wrote the script, but the issue i am having (i believe) is when you hit “send” it does not locate the .php file on my server. The PHP file is called send51.php and is located in this directory: [http://www.houseofbrewsny.com/PHP](http://www.houseofbrewsny.com/PHP)

Any help would be great!

Here’s the script in Flash and I’ll put the PHP beneath it.

stop();  
var senderLoad:LoadVars = new LoadVars();  
var receiveLoad:LoadVars = new LoadVars();  
sender.onRelease = function() {  
senderLoad.theName = theName.text;  
senderLoad.theEmail = theEmail.text;  
senderLoad.thePhone = thePhone.text;  
senderLoad.theMessage = theMessage.text;  
senderLoad.sendAndLoad("\<A href=“[http://www.houseofbrewsny.com/PHP/send51.php",receiveLoad"](http://www.houseofbrewsny.com/PHP/send51.php%22,receiveLoad%22)\>[http://www.houseofbrewsny.com/PHP/send51.php](http://www.houseofbrewsny.com/PHP/send51.php)”,receiveLoad);  
}  
receiveLoad.onLoad = function() {  
if(this.sentOk) {  
\_root.gotoAndStop(“success”);  
}  
else {  
\_root.gotoAndStop(“failed”);  
}  
}

PHP

\<?PHP  
$to = [sjaworsk1@hotmail.com](mailto:sjaworsk1@hotmail.com);  
$subject = “Website Email Form”;  
$message = "Name: " . $theName;  
$message .= "  
Email: " . $theEmail;  
$message .= "

Phone: " . $thePhone;  
$message .= "

Message: " . $theMessage;  
$headers = “From: $theEmail”;  
$headers .= "  
Reply-To: $theEmail";  
$sentOk = mail($to,$subject,$message,$headers);  
echo “sentOk=” . $sentOk;  
?\>
