# loadVars.sendAndLoad

**URL:** <https://forum.kirupa.com/t/loadvars-sendandload/171533>\
**Category:** flash\
**Created:** [December 6, 2005, 10:35am UTC](https://forum.kirupa.com/t/loadvars-sendandload/171533 "2005-12-06T10:35:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rille31](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@rille31](https://forum.kirupa.com/u/rille31)\
**Post date:** [December 6, 2005, 10:35am UTC](https://forum.kirupa.com/t/loadvars-sendandload/171533/1 "2005-12-06T10:35:40Z")

</div>

Need some help getting back the answervariabel from the phpfile  
turns up undefined, the code

```php
 
lv = new LoadVars();
new_lv = new LoadVars();
new_lv.onLoad = function() {
if (this.sent== "OK") {
statusmsg.text = "something";
play();
} else {
statusmsg.text = "something else";
play();
}
};
function sendMessage() {
lv.text1 = t1.text;
lv.sendAndLoad("textfiles/movie1writer.php", new_lv, "POST");
statusmsg.text = "checking...";
}

```

```php
 
<? 
$fd = fopen("movie1.txt", "w"); 
$write = fwrite($fd, "text1=$text1"); 
if ($write){ 
	echo urlencode("sent=failed"); 
	}else{ 
		echo urlencode("sent=failed"); 
		} 

```
