have a form that a name has been entered and need to add it to xml file.
index.html
<form name="form" action="insert.php" method="post">
<label for="name">Name:</label> <br />
<input type="text" name="name" id="name" /> <br />
<button type="submit" id="button">Submit</button>
<br />
<span id="validate"></span>
</form>
insert.php
header('Location:index.php');
$xmldoc = new DOMDocument();
$xmldoc->load('recentUploads.xml');
$Name = $_POST['name'];
$root = $xmldoc->firstChild;
$fileName = $xmldoc->createElement('name');
$root->appendChild($fileName);
$newText1 = $xmldoc->createTextNode($Name);
$fileName->appendChild($newText1);
$xmldoc->save('recentUploads.xml');
but i can not add anything to the xml file?
Help!