# Saving form data into xml using php

**URL:** <https://forum.kirupa.com/t/saving-form-data-into-xml-using-php/276658>\
**Category:** Uncategorized\
**Created:** [December 2, 2008, 11:52am UTC](https://forum.kirupa.com/t/saving-form-data-into-xml-using-php/276658 "2008-12-02T11:52:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sukanya\_paul](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@sukanya\_paul](https://forum.kirupa.com/u/sukanya_paul)\
**Post date:** [December 2, 2008, 11:52am UTC](https://forum.kirupa.com/t/saving-form-data-into-xml-using-php/276658/1 "2008-12-02T11:52:03Z")

</div>

hi,  
i have form with few text fields, When i submit the form the data should for an xml file. i am not sure how to do this.

```auto
<form action="xml.php" name="data" method="post">
Name:<input type="text" name="ename" id="ename" />
Age: <input type="text" name="age" id="age" />
<input type="submit" value="submit" name="submit" />
</form>

```

when i submit the above formit should create an .xml file  
\<?xml version=“1.0” encoding=“ISO-8859-1” ?\>  
\<data\>  
\<name\>sukanya\</name\>  
\<age\>26\</age\>  
\</data\>  
if the posted data for name is sukanya and age is 26  
can some1 help i’m tryin to find for quite a while but not able to
