OM2 Posted July 27, 2008 Share Posted July 27, 2008 Need help programming an XML reader and writer. Me: newbie to PHP, have done lots of little snippets of programming (mostly adjusting existing code). I want to program my own mini CMS for an XML file - to read and write to the XML file. Firstly: what do I need!? 1. Reading in the XML file. I assume there must be lots of code examples of reading in XML in PHP? Any recommended code snippets would be great. Else, I'll google. I want to read in the XML file and be able to access the contents easily - should I store in an array or something? Or is it easier to reference the object that loads the XML file? 2. Need to be able to edit the contents and save. On a simple level, I want to be able to enter values directly or even choose from drop down boxes. BUT: I also want to be able to upload images (and video files). For the uploading part: would it be better for me to use a well developed open source browser? Can someone reommend an open source browser...? In editing the XML file, I want to be able to create new records. I need to be able to move things up and down and move to the top and move to the bottom. I also need to delete specific files and be able to choose several files and delete them. I've ask for quite a lot above. I'm not looking for a full answer all in one go! Any pointers where to start would be great! I'll come back and ask when I get stuck on specific points. Thanks. OM Link to comment https://forums.phpfreaks.com/topic/116785-need-help-programming-an-xml-reader-and-writer/ Share on other sites More sharing options...
DarkWater Posted July 27, 2008 Share Posted July 27, 2008 Why not use a database and construct an XML file when needed for any output to RSS clients and/or web services? Much easier than XML manipulation. If you're still adamant about doing it, check out SimpleXML. Link to comment https://forums.phpfreaks.com/topic/116785-need-help-programming-an-xml-reader-and-writer/#findComment-600566 Share on other sites More sharing options...
OM2 Posted July 27, 2008 Author Share Posted July 27, 2008 thanks for the reply: insist on xml. looking up SimpleXML now. Link to comment https://forums.phpfreaks.com/topic/116785-need-help-programming-an-xml-reader-and-writer/#findComment-600567 Share on other sites More sharing options...
DarkWater Posted July 27, 2008 Share Posted July 27, 2008 Okay, here's a really honest opinion. I think that kind of XML manipulation is going to make you tear your hair out. A database is about 200 times easier to work with, and it's much easier to retrieve information. Why not use one? Link to comment https://forums.phpfreaks.com/topic/116785-need-help-programming-an-xml-reader-and-writer/#findComment-600569 Share on other sites More sharing options...
OM2 Posted July 27, 2008 Author Share Posted July 27, 2008 ur probably right. i need soemthing light weight that i can chuck into anyhwere and it will just work. i wont giv eup hope just yet. Link to comment https://forums.phpfreaks.com/topic/116785-need-help-programming-an-xml-reader-and-writer/#findComment-600588 Share on other sites More sharing options...
DarkWater Posted July 27, 2008 Share Posted July 27, 2008 *cough Database cough* Sorry, bad allergies. Anyway, XML is going to be way to slow and cluttered after a while. Link to comment https://forums.phpfreaks.com/topic/116785-need-help-programming-an-xml-reader-and-writer/#findComment-600592 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.