# \<'s and \>'s turning into &lt; and &gt; from textbox

**URL:** <https://forum.kirupa.com/t/s-and-s-turning-into-lt-and-gt-from-textbox/254429>\
**Category:** flash\
**Created:** [March 12, 2008, 1:22am UTC](https://forum.kirupa.com/t/s-and-s-turning-into-lt-and-gt-from-textbox/254429 "2008-03-12T01:22:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbf3](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@bbf3](https://forum.kirupa.com/u/bbf3)\
**Post date:** [March 12, 2008, 1:22am UTC](https://forum.kirupa.com/t/s-and-s-turning-into-lt-and-gt-from-textbox/254429/1 "2008-03-12T01:22:13Z")

</div>

actionscript:

```auto
var input_xml = new XML();
input_xml.ignoreWhite = true;
input_xml.contentType = "text/xml";
input_xml.onLoad = function(success){
    if (success) input_txt.text = this.firstChild.firstChild.nodeValue;
    else input_txt.text = "Error loading input XML";
}

var output_xml = new XML();
output_xml.ignoreWhite = true;
output_xml.onLoad = function(success){
    if (success) output_txt.text = this.firstChild.firstChild.nodeValue;
    else output_txt.text = "Error loading output XML";
}

var xml_file = "readwrite/simple_edit.xml";
var server_file = "simple_save.php";

load_btn.onRelease = function(){
    input_txt.text = "Loading...";
    input_xml.load(xml_file + "?uniq=" + new Date().getTime());
}
send_btn.onRelease = function(){
    input_xml.parseXML("<edit> new text </edit>");
    input_xml.firstChild.firstChild.nodeValue = input_txt.text;
    input_xml.xmlDecl = ""; // declaration duplication bug
    input_xml.sendAndLoad(server_file, output_xml);
    output_txt.text = "Loading...";
}

clearin_btn.onRelease = function(){
    input_txt.text = "";
}
clearout_btn.onRelease = function(){
    output_txt.text = "";
}

```

my xml:

```auto
<?xml version="1.0"?><edit>This is meant to be edited</edit>

```

my php (although i think it’s an actionscript problem:

```php
<?php
$filename = "readwrite/simple_edit.xml";
$raw_xml = file_get_contents("php://input");

print $raw_xml;

$fp = fopen($filename, "w");
fwrite($fp, $raw_xml);
fclose($fp);
?>

```

when I press the send button and change my text in the input\_txt.text into  
a node value with

```auto
 input_xml.firstChild.firstChild.nodeValue = input_txt.text;

```

if my text includes \<'s or \>'s or any special characters, they get converted away, rendering my final xml product useless (with \<'s there is no tags). Is there a way around this?

code is from kirupa’s [http://www.kirupa.com/web/xml/examples/simpleeditor.htm](http://www.kirupa.com/web/xml/examples/simpleeditor.htm) awesome tutorial.

Any thoughts would be totally helpful,  
Blake
