The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Edit XML with PHP Re: Edit XML with PHP

Capt Otis

Here’s how I would do that…

Place the xml file writing script at the top of your page. Then wrap it in an if statement, to check if the user has submitted the form. Also check your form sends to itself.

Then you can change the saving file to this…

if ($doc->save($xmlLoc)){
$varName = ‘You have saved successfully… blah blah’;
} else {
$varName = ‘An error has occurred’.

Then echo $varName where ever you want on the page if it isset().