I was trying to insert new data into an existing XML file, but it\'s not working. Here\'s my xml file:
swimming
is your code block copy and pasted from your existing files? if so i see two potential issues:
note: you're missing action="insert.php", which would cause the form to just reload itself without submitting, which is the behaviour you describe.
secondly, make sure you have write permission to "sample.xml". you can confirm if you're actually writing anything:
print 'I wrote '.$xmldoc->save('sample.xml').' bytes of data';