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

Well its a function. You send it the variables that it takes and it will do the work for you.

Put the function in the page you want to edit the xml file. Then call the function sending it the information it needs.

updateXML(‘Package 1′,’$750′,’This is a description for Package 1.’,’New Title’,’New Price’,’New Description’);

The first 3 parameters are the old information of the block of xml you want to change. The last three are the new values you want to change them to. If you used a form, you would need to find a way to store the old information and send both the old and new values to the function. That line above executes the function. So take that out of the example I gave you. Say you sent all the data using a form, you would end up with something like

updateXML($_Post[‘oldtitle’], $_POST[‘oldprice’], $_POST[‘olddesc’], $_Post[‘newtitle’], $_POST[‘newprice’], $_POST[‘newdesc’]);

Sorry this is a little hard to explain if you don’t know how to use a function. Make any sense?