# Using LoadVars to Retrieve XML but ampersand (&) messing it up

**URL:** <https://forum.kirupa.com/t/using-loadvars-to-retrieve-xml-but-ampersand-messing-it-up/219969>\
**Category:** Uncategorized\
**Created:** [March 21, 2007, 4:31pm UTC](https://forum.kirupa.com/t/using-loadvars-to-retrieve-xml-but-ampersand-messing-it-up/219969 "2007-03-21T16:31:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidOrtiz](https://avatars.discourse-cdn.com/v4/letter/d/e480ec/32.png) [@DavidOrtiz](https://forum.kirupa.com/u/DavidOrtiz)\
**Post date:** [March 21, 2007, 4:31pm UTC](https://forum.kirupa.com/t/using-loadvars-to-retrieve-xml-but-ampersand-messing-it-up/219969/1 "2007-03-21T16:31:56Z")

</div>

i dont want to use XML object for this. Is there anyway at all to make my xml format come back correctly. the ampersand seems to be calling loadvars to think its a different variable obviously.

any way aroun dit?

my simple php script is:

```php

<?
 $firstName = $_GET['firstName'];
 $lastName = $_GET['lastName'];
  
 print "&returnFirst=". $firstName . "
";
 print "<xmltype>
";
 print "<one>http://www.fakesite.com?returnMe=fuzz&returnResult=boom</one>
";
 print "</xmltype>
";
 print "&returnLast=". $lastName . "
";
 
?>

```

my as file is:

```php

var sendForm:LoadVars = new LoadVars();
sendForm.firstName = "John";
sendForm.lastName = "Smith";
sendForm.sendAndLoad("test.php",sendForm,"GET");

sendForm.onLoad = function(success){
    if(success){
        myXML = new XML();
        myXML.ignoreWhite = true;
        myXML.contentType = "text/html";
        myXML.parseXML(unescape(this));
        
        mytxt.text = unescape(this);
    }
};

```

my output is:

```php

returnLast=Smith
&returnResult=boom</one>
</xmltype>
&returnFirst=John
<xmltype>
<one>http://www.fakesite.com?returnMe=fuzz&onLoad=[type Function]&lastName=Smith&firstName=John

```
