# Better way to send to php?

**URL:** <https://forum.kirupa.com/t/better-way-to-send-to-php/250732>\
**Category:** flash\
**Created:** [January 31, 2008, 11:33pm UTC](https://forum.kirupa.com/t/better-way-to-send-to-php/250732 "2008-01-31T23:33:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![four4swords](https://avatars.discourse-cdn.com/v4/letter/f/87869e/32.png) [@four4swords](https://forum.kirupa.com/u/four4swords)\
**Post date:** [January 31, 2008, 11:33pm UTC](https://forum.kirupa.com/t/better-way-to-send-to-php/250732/1 "2008-01-31T23:33:00Z")

</div>

hi,

I have this code here which i use to send info from my flash file to my php file… and back…

```php
types = new LoadVars();
types.exe = "battleresultsupdates";
types.which = "wins";
types.amount = _root.battlewins;
types.sendAndLoad("rpgexe.php", types, "POST");
types.onLoad = function() {
    types = new LoadVars();
    types.exe = "battleresultsupdates";
    types.which = "experience";
    types.amount = _root.experience;
    types.sendAndLoad("rpgexe.php", types, "POST");
    types.onLoad = function() {
        if (_root.enemy_item.length>0) {
            types.exe = "boughtitemplayer";
            types.inserteditem = dropped;
            types.item_extras = "";
            types.item_type = "";
            types.sendAndLoad("rpgexe.php", types, "POST");
            types.onLoad = function() {
            };
        }
        types = new LoadVars();
        types.exe = "boughtitemplayer";
        types.inserteditem = dropped;
        types.item_extras = "";
        types.item_type = "";
        types.sendAndLoad("rpgexe.php", types, "POST");
        types.onLoad = function() {
        };
        resultmess += "<br>You stole their <b>: "+dropped+"</b>";
    };
};
types = new LoadVars();
types.exe = "disconnectionfalse";
types.sendAndLoad("rpgexe.php", types, "POST");
types.onLoad = function() {
    types = new LoadVars();
    types.exe = "ADDmoney";
    types.amount = money;
    types.sendAndLoad("rpgexe.php", types, "POST");
    types.onLoad = function() {
        _root.main.battlebox.das._visible = false;
        _root.main.battlebox.continuebutton._visible = true;
    };
};

```

So… what it’s doing is… everytime i have one of these…

```php
 types = new LoadVars();
    types.exe = "stuff";
    types.sendAndLoad("rpgexe.php", types, "POST");
    types.onLoad = function() {
        do next php thing..
    };

```

It sends info to my php file… then… once it gets a reply… it does the next lot… and so on and so on…

Is there a way to just combine it ALL at once and just send it as one huge lot?

lol I hope you guys can see what i’m trying to say here!lol
