Reputation: 388
I'm thinking of using XML for storing users content on my web app. I am a php newbie and don't know much about how I would do this.
The content is private to the user, not shared public or for passwords or anything. So I was wondering how I can create and edit xml files on the backend part of the server, privately accessed by PHP like what it does with mySQL.
My questions are: 1) Is it possible 2) If so, how would I do it using php etc.
Upvotes: 1
Views: 153
Reputation: 13544
Theoretically it is possible. by making your xml in php files format which output xml formatted tags after PHP authentication. The PHP files will be created dynamically using PHP filesystem functions and will be modified also, for each users in a specified folder(s) for your users.
Upvotes: 0
Reputation: 5351
Put all xml files in a folder that is not accessible via the web, so outside of your document root. Alternatively, you can use .htaccess to restrict access to that folder.
For reading and writing those xml files from your directory, you can use simplexml. You don't need anything else despite pure php and some xml processing.
This should get you started ;).
Upvotes: 3