# XML.sendAndLoad and getting PHP to parse it

**URL:** <https://forum.kirupa.com/t/xml-sendandload-and-getting-php-to-parse-it/236782>\
**Category:** programming\
**Created:** [August 23, 2007, 4:41pm UTC](https://forum.kirupa.com/t/xml-sendandload-and-getting-php-to-parse-it/236782 "2007-08-23T16:41:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ironchefmoto](https://avatars.discourse-cdn.com/v4/letter/i/91b2a8/32.png) [@ironchefmoto](https://forum.kirupa.com/u/ironchefmoto)\
**Post date:** [August 23, 2007, 4:41pm UTC](https://forum.kirupa.com/t/xml-sendandload-and-getting-php-to-parse-it/236782/1 "2007-08-23T16:41:00Z")

</div>

I’m building a little Flash voting tool that has to get a user’s chooses between two people – giving one or the other a vote/thumbs up for 5-10 categories. When all categories have been voted on between the two people, I send those votes to a database, and return the total tally of votes for the categories BACK to Flash to render results and show the user what the aggregate vote results look like.

Because I could have an infinite # of categories, I need to send some structured XML from Flash:

```auto
<votes>
<vote id='1' type='alpha' />
<vote id='2' type='beta' />
<vote id='3' type='tie' />
<vote id='4' type='beta' />
</votes

```

id = the database “categories” table ID for the category on which I’m voting.

type = alpha, beta, or tie. Basically – there are two people (alpha and beta) – you vote one or the other or give a tie.

I COULD use AMFPHP, but I’m a newb at PHP right now, and for this first version, I will need to use XML.sendAndLoad, send the the code above, parse it in PHP and update the votes database, and then send back some XML with the overall aggregate results.  
\*\*  
How can I keep this simple on the PHP XML parse side? I’ve looked at the PHP XML parser and nearly pooped my pants. It’s nuts. Any suggestions? Should I hunker down and learn how to do this with AMFPHP? Or should I find a way to send structured data via a LoadVars instead? So I’m not parsing XML in PHP?\*\*

Thanks,  
IronChefMorimoto
