Home › Forums › Back End › Edit XML with PHP › Re: Edit XML with PHP
June 23, 2010 at 10:16 am
#78573
Capt Otis
Member
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…
Code:
if ($doc->save($xmlLoc)){
$varName = ‘You have saved successfully… blah blah’;
} else {
$varName = ‘An error has occurred’.
}
$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().