# Simple LoadVars confusion

**URL:** <https://forum.kirupa.com/t/simple-loadvars-confusion/214581>\
**Category:** Uncategorized\
**Created:** [January 30, 2007, 9:56am UTC](https://forum.kirupa.com/t/simple-loadvars-confusion/214581 "2007-01-30T09:56:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scriptrookie](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@scriptrookie](https://forum.kirupa.com/u/scriptrookie)\
**Post date:** [January 30, 2007, 9:56am UTC](https://forum.kirupa.com/t/simple-loadvars-confusion/214581/1 "2007-01-30T09:56:13Z")

</div>

hi guys,

i was trying to learn how to do LoadVars with PHP. But i think i got lost in confusion with the path when to actually view the output, here’s the code:

```auto

var sendVar:LoadVars = new LoadVars();
var getVar:LoadVars = new LoadVars();
sendVar.flashVal = 5;
sendVar.sendAndLoad("http://localhost/loadvar/loadvar.php",getVar);
getVar.onLoad = function(){
trace(this.newVal);
}

```

and here’s the php code:

```php

<?php
$phpVal = "$_POST['flashVal']";
$newVal = "$phpVal + 5";
echo $newVal;
?>

```

when i tried to see the result in flash through trace, i get an “undefined” value. I was ok with making .load for flash but i got lost with .sendAndLoad, esp on how to capture the variables sent from php to flash.

i would be thankful for anyone who has a good solution for this.

thanks for anyone’s help!

\_ScriptRookie
