title: Add HTML Codes to XML file using PHP
body: <p>i have an xml file (scores.xml) which im using a php codes to add new Tags to it...</p>
  
  <p>i have a tag called Header which contain some html code</p>
  
  <pre><code>&lt;![CDATA[&lt;tr&gt;&lt;td colspan='7' id='headertd'&gt;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &lt;img border='0' src='images/euro.png' /&gt;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  UEFA Euro 2012 Qualifications&lt;/td&gt;&lt;/tr&gt;]]&gt;
  </code></pre>
  
  <p>when im writing this code in the form of the pgp script and submiting everything goes normal to the XML file except the header tag.... im getting an error in the php script and the code is going in the xml tag like that:</p>
  
  <pre><code>&amp;lt;![CDATA[&amp;lt;tr&amp;gt;&amp;lt;td colspan='7' id='headertd'&amp;gt;&amp;#13;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#13;
  &amp;lt;img border='0' src='images/euro.png' /&amp;gt;&amp;#13;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#13;
  UEFA Euro 2012 Qualifications&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;]]&amp;gt;
  </code></pre>
  
  <p>so thats getting wong info to my xml...
  is there anyway i can fix this ? and avoid the transformation of these codes?</p>
  
  <p>thats my php code :</p>
  
  <pre><code>&lt;?php
  if (isset($_POST['submitted'])) {//If the user submitted the form, then add to the XML file
      //Load the scores XML file
      $scores = new DOMDocument();
      $scores -&gt; load('../scores.xml');
  
      //Get the &lt;Games&gt; tag
      $games = $scores -&gt; getElementsByTagName('Games');
  
      //Create the new &lt;Game&gt; tag (Could probably be done better by first placing everything in an array or something)
      $newGame = $scores -&gt; createElement("Game");
      $newGame -&gt; appendChild($scores -&gt; createElement("Header", $_POST['header']));
      $newGame -&gt; appendChild($scores -&gt; createElement("Row", $_POST['row']));
      $newGame -&gt; appendChild($scores -&gt; createElement("Date", $_POST['date']));
      $newGame -&gt; appendChild($scores -&gt; createElement("Time", $_POST['time']));
      $newGame -&gt; appendChild($scores -&gt; createElement("HomeTeam", $_POST['hometeam']));
      $newGame -&gt; appendChild($scores -&gt; createElement("Score", $_POST['score']));
      $newGame -&gt; appendChild($scores -&gt; createElement("AwayTeam", $_POST['awayteam']));
      $newGame -&gt; appendChild($scores -&gt; createElement("Other", $_POST['other']));
      $newGame -&gt; appendChild($scores -&gt; createElement("InfoID", $_POST['infoid']));
      $newGame -&gt; appendChild($scores -&gt; createElement("InfoData", $_POST['infodata']));
  
      //Add the new &lt;Game&gt; tag under the &lt;Games&gt; tag
      $games -&gt; item(0) -&gt; appendChild($newGame);
  
      //Save again
      $scores -&gt; save('../scores.xml');
  
      echo "New game added.";
  }
  ?&gt;
  </code></pre>
  
  <p>and this php is connected to a form that looks like that :</p>
  
  <pre><code>&lt;form id="form1" method="post" action=""&gt;
  &lt;table id="table2"&gt;
  
  &lt;tr&gt;&lt;td&gt;Header:&lt;/td&gt; &lt;td&gt;&lt;textarea style=" color:#000;" name="header" cols="73" rows="6" &gt; &lt;/textarea&gt;&lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;&lt;td&gt;Row:&lt;/td&gt; &lt;td&gt;&lt;input id='textfield' type="text" size="70" name="row" value='A or B' onfocus="inputFocus(this)" onblur="inputBlur(this)"&gt;&lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;&lt;td&gt;Date:&lt;/td&gt; &lt;td&gt;&lt;input id='textfield' type="text" size="70" name="date" value='Date and time of the match' onfocus="inputFocus(this)" onblur="inputBlur(this)"&gt;&lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;&lt;td&gt;Time:&lt;/td&gt; &lt;td&gt;&lt;input id='textfield' type="text" size="70" name="time" value='Current time' onfocus="inputFocus(this)" onblur="inputBlur(this)"&gt;&lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;&lt;td&gt;HomeTeam:&lt;/td&gt; &lt;td&gt;&lt;input id='textfield' type="text" size="70" name="hometeam" value='Home Team' onfocus="inputFocus(this)" onblur="inputBlur(this)"&gt;&lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;&lt;td&gt;Score:&lt;/td&gt; &lt;td&gt;&lt;input id='textfield' type="text" size="70" name="score" value='Score' onfocus="inputFocus(this)" onblur="inputBlur(this)"&gt;&lt;/td&gt;&lt;td&gt;"3 - 2"&lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;&lt;td&gt;AwayTeam:&lt;/td&gt; &lt;td&gt;&lt;input id='textfield' type="text" size="70" name="awayteam" value='Away Team' onfocus="inputFocus(this)" onblur="inputBlur(this)"&gt;&lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;&lt;td&gt;Other:&lt;/td&gt; &lt;td&gt;&lt;input id='textfield' type="text" size="70" name="other" value='Additional Info' onfocus="inputFocus(this)" onblur="inputBlur(this)"&gt;&lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;&lt;td&gt;InfoID:&lt;/td&gt; &lt;td&gt;&lt;input id='textfield' type="text" size="70" name="infoid" value='The ID of the Popup' onfocus="inputFocus(this)" onblur="inputBlur(this)" &gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;&lt;td&gt;InfoData:&lt;/td&gt; &lt;td&gt;&lt;textarea id='textfield' value='Data of the Popup' onfocus="inputFocus(this)" onblur="inputBlur(this)" name="infodata" cols="73" rows="6"&gt;&lt;/textarea&gt;&lt;/td&gt;&lt;td&gt;
  
  &lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td&gt;&lt;input type="submit" name="submitted" name="Add new row"&gt;&lt;/td&gt;&lt;td&gt; &lt;td&gt;&lt;/td&gt; 
  
  &lt;/table&gt;
  
   &lt;style&gt;
   BODY {font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; color:#333; font-size:11px;}
   #textfield {color:#888;}
   #table2 td, tr { padding-right:10px;}
   &lt;/style&gt;
  </code></pre>