PHP with XML, simple blog
Posted: Fri Jun 30, 2006 8:21 pm
Ok I am making a simple blog script with XML.
My problem is reading from the XML file.
I only want to display the latest blog post, which should be the last element from my XML file. I also have links included like "Next" / "Previous" where if clicked it'll goto the next and previous posts from the XML file.
Anyway, how can I display only one, the latest post on the web page without loading the entire XML file to memory and sifting through it all to the last element?
And how can i jump to the next element?
If I were using javascript it would be easy by using javascript:productTable.nextPage() and doing something like <table datasrc='#xmldata' datapagesize="1" id="productTable"> <span datafld='element1'>
But I'm trying to do it with PHP.
My problem is reading from the XML file.
I only want to display the latest blog post, which should be the last element from my XML file. I also have links included like "Next" / "Previous" where if clicked it'll goto the next and previous posts from the XML file.
Anyway, how can I display only one, the latest post on the web page without loading the entire XML file to memory and sifting through it all to the last element?
And how can i jump to the next element?
If I were using javascript it would be easy by using javascript:productTable.nextPage() and doing something like <table datasrc='#xmldata' datapagesize="1" id="productTable"> <span datafld='element1'>
But I'm trying to do it with PHP.