panherz Posted May 5, 2012 Share Posted May 5, 2012 Hi, I have found myself in a bit of a cul-de-sac. Hope you can help as it is driving me crazy. The scenario: I have an html form (_post) which I would like to write the contents of to a one XML file using php. The problem is: The html page has three/four forms in it. Form a = (submit a writes/updates only to section a) Form b = (submit b writes/updates only to section b) Form c = (submit c writes/updates only to section c) Form d= (submit a, b, c writes/updates all sections) The XML page has three sections a, b & c To conclude, I want to be able to update the XML file in sections or update them all as a whole. How can I go about achieving this? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/262123-html-forms-php-to-xml/ Share on other sites More sharing options...
ignace Posted May 5, 2012 Share Posted May 5, 2012 Have an hidden input field named section in each form: <input type="hidden" name="section" value="a"> Then when processing check which section: if ($_POST['section'] === 'a') { // section a processing } For the d part, let that be the else: } else if ($_POST['section'] === 'c') { // section c processing } else { // section d processing } Quote Link to comment https://forums.phpfreaks.com/topic/262123-html-forms-php-to-xml/#findComment-1343318 Share on other sites More sharing options...
panherz Posted May 5, 2012 Author Share Posted May 5, 2012 Fantastic. Will give that a try. Thanks guru. Quote Link to comment https://forums.phpfreaks.com/topic/262123-html-forms-php-to-xml/#findComment-1343342 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.