# XML with PHP 4.3" inserting child nodes to XML file

**URL:** <https://forum.kirupa.com/t/xml-with-php-4-3-inserting-child-nodes-to-xml-file/262692>\
**Category:** programming\
**Created:** [June 9, 2008, 8:12am UTC](https://forum.kirupa.com/t/xml-with-php-4-3-inserting-child-nodes-to-xml-file/262692 "2008-06-09T08:12:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![winey](https://avatars.discourse-cdn.com/v4/letter/w/a183cd/32.png) [@winey](https://forum.kirupa.com/u/winey)\
**Post date:** [June 9, 2008, 8:12am UTC](https://forum.kirupa.com/t/xml-with-php-4-3-inserting-child-nodes-to-xml-file/262692/1 "2008-06-09T08:12:28Z")

</div>

Hi i need some help inserting child elements to existing xml file from a html form using php my xml file looks like this

\<mother\>  
\<child attribute = abcd /\>  
\<child2\> data \</child2\>  
\<child3\> data \</child3\>  
\<child4\> data \</child4\>

```
   &lt;child attribute = abcd /&gt;
   &lt;child2&gt; data &lt;/child2&gt;
   &lt;child3&gt; data &lt;/child3&gt;
   &lt;child4&gt; data &lt;/child4&gt;

```

\</mother\>

now i want to be able to insert another set of \<child attrbute = abcd /\> etc… before the \</mother\> tag into my xml file from a html form with php scripting unfortunately my server does not support php 5 DOM functions.

kindly help
