HomeXML Page 2 - Creating an RSS Reader Application
Code - XML
In the previous two articles we discussed how to read and build an RSS document with PHP. In this article we will create an application that uses the concepts discussed in the other two articles. So letís go straight to the coding.
The logical way to create an application to automate the building of an RSS document would be to offer the user a choice between creating an Enhanced RSS document or a Simple RSS document, and then to proceed from there.
So let's create a PHP page with a navigation bar on the left that will contain two links:
Read an RSS document
Create an RSS document
The idea is to use one page on which we do everything, so we are going to create a few functions to display information according to whichever link a user has selected.
When the "Read RSS document" link is pressed, the "showfrm" function is activated; it then displays a form requesting the name of the RSS document to be opened. Once you've entered and submitted the document name, a function called "showparsedContents" is called; it then parses the document. Below are the showfrm and showparsedContents() functions: