# Pass vars to PHP

**URL:** <https://forum.kirupa.com/t/pass-vars-to-php/214818>\
**Category:** Uncategorized\
**Created:** [February 1, 2007, 8:14am UTC](https://forum.kirupa.com/t/pass-vars-to-php/214818 "2007-02-01T08:14:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brndn](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@brndn](https://forum.kirupa.com/u/brndn)\
**Post date:** [February 1, 2007, 8:14am UTC](https://forum.kirupa.com/t/pass-vars-to-php/214818/1 "2007-02-01T08:14:13Z")

</div>

hey is it possible to pass a variable through to PHP and onto an email???  
kinda like

```auto
 
var name_var = "myname";
var location_var = "where im at";
 
send_button.onRelease = function()
{
 
var formData:LoadVars = new LoadVars();
var formData.name = name_var;
var formData.location = location_var;
formData.sendAndLoad("http://www.mysite.com/contact_process.php",_blank,"POST");
 
formData.onLoad = function()
{
if(formData.message_sent == "ok")
{ 
gotoAndStop(2); 
}
else
{ 
gotoAndStop(3); 
}
}
}

```

```php
<?php
// Send the message
$mailfrom="<$_POST[email]>";
$email=blah@mysite.com;
$subject="order form ";
Location:$_POST[location]<br><br>[name]
$headers = "MIME-Version: 1.0
";
$headers .= "Content-type: text/html; charset=iso-8859-1
";
$headers .= "From: ". $mailfrom."
";
mail($email,$subject,$data,$headers);
echo "message_sent=ok";
?> 

```

I just threw this together from others.  
I guess i might as well test it.

> 

[COLOR=#0000bb][FONT=Courier New]$data[/FONT][/COLOR]  
Where is this php variable set or is it global to all the data passed??
