Sunday, November 18, 2012

Answers > Is There Any Php Programs That Let People Write a Document and Change There Writing to Settable Xml Tags?

Is There Any Php Programs That Let People Write a Document and Change There Writing to Settable Xml Tags?

by nForms on June 10, 2012

I need to be able to put clients articles into a flash website and I am trying to make it easy for him -- right now I have it set up so he could write it in xml but that does not seem practical

Tags: , , ,

Similar XForms | XML Posts

{ 1 comment… read it below or add one }

Leon Blade August 25, 2011 at 11:58 am

I suggest you work on your spelling and grammar a little bit… just a tip.

But anyhow, on to your question.
Anything is possible but I’m not sure what you are asking.

Basically what I think I’m getting is the Flash website reads XML, parses it, and then outputs some sort of article of some sort?

You can write your own PHP to do this, it’s much easier in the long run and is good practice to learn how to do this kind of stuff.

First off you would have a form in HTML that would contain all your fields that you want to fill out, these would be the different tags you need in your XML. So say your XML needed a date, title, body and what not, you could make text boxes and stuff for those fields to make it more user friendly than writing it in XML. By using a form rather than typing the XML it makes things a lot more easier for the person who needs to do it.

Once you made your HTML form you can setup your PHP to receive the form through POST or whatever you used. once you have all the information stored in variables or however you want to do it, you can now echo out XML.

Example:
echo "<?xml version=’1.0′ encoding=’utf-8′?>\n";
echo "<article>\n";
echo "<date>" . $articleDate . "</date>";

You can make a direct reference to this PHP and it will be just like regular XML. However, if you want to create a physical XML file instead, you would store your XML in a variable rather than echoing it out and then use a stream to write your XML to a new file.

And that’s pretty much it!
You shouldn’t have too much trouble with it.
If you need more help then you can e-mail me at:
leon.blade@gmail.com

Previous post:

Next post: