# Sending some data to PHP

**URL:** <https://forum.kirupa.com/t/sending-some-data-to-php/256613>\
**Category:** Uncategorized\
**Created:** [April 4, 2008, 4:14pm UTC](https://forum.kirupa.com/t/sending-some-data-to-php/256613 "2008-04-04T16:14:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xstevenx](https://avatars.discourse-cdn.com/v4/letter/x/4491bb/32.png) [@xstevenx](https://forum.kirupa.com/u/xstevenx)\
**Post date:** [April 4, 2008, 4:14pm UTC](https://forum.kirupa.com/t/sending-some-data-to-php/256613/1 "2008-04-04T16:14:52Z")

</div>

I need some tips on how to send out some data to a PHP file. I have a project set up already where you vote for some options and that sends, but now I need to add some input text fields for people to enter some personal information. What I have right now are two fields with the vars of “name” & “email”

And here’s the code that is sending out the information to the PHP file:

```auto
submit.onRelease = function():Void

{
    sendVars();
    _root.gotoAndStop(2);
}

myLv.onLoad = function():Void
{
trace("data sent");
}
function sendVars():Void
{
    var len:Number = resultArray.length;
    for (i=1;i<len;i++)
    {
        myLv["var"+i]=resultArray*;
    }
    myLv.sendAndLoad("myphp.php",myLv,"POST");
}

```

I’ve tried a couple of different ways but so far all of them failed, they included creating another function like the “sendVars” function to send with the submit button and I also tried placing some code into the “sendVars” function relating to the “name” & “email” vars.

If anyone could provide some help on how to do this I would greatly appreciate it. Thank you so much!
