PHP with XML, simple blog
Moderator: General Moderators
-
midfielder
- Forum Newbie
- Posts: 1
- Joined: Fri Jun 30, 2006 8:11 pm
PHP with XML, simple blog
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.
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
-
Robert Plank
- Forum Contributor
- Posts: 110
- Joined: Sun Dec 26, 2004 9:04 pm
- Contact:
-
texasrenegade
- Forum Newbie
- Posts: 6
- Joined: Thu Jun 29, 2006 1:16 pm
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
-
texasrenegade
- Forum Newbie
- Posts: 6
- Joined: Thu Jun 29, 2006 1:16 pm
I only know how to do this in Dreamweaver. I use xhtml transitional but could be using strict.
Here is a link to a tutorial
http://livedocs.macromedia.com/dreamwea ... _dis14.htm
that saves me from detailing all the steps.
Also on a side note:
Note: Microsoft ASP.NET refers to a recordset as a DataSet. If you are working with ASP.NET document types, the dialog boxes and menu choices specific to ASP.NET use the label DataSet. The Dreamweaver documentation generically refers to both types as recordsets, but uses DataSet when specifically describing ASP.NET features.
Now, there are even behaviors or extensions available for Dreamweaver to help this. I could create an example I guess and he could just modify the code... for his needs.
Let me know...
r
Here is a link to a tutorial
http://livedocs.macromedia.com/dreamwea ... _dis14.htm
that saves me from detailing all the steps.
Also on a side note:
Note: Microsoft ASP.NET refers to a recordset as a DataSet. If you are working with ASP.NET document types, the dialog boxes and menu choices specific to ASP.NET use the label DataSet. The Dreamweaver documentation generically refers to both types as recordsets, but uses DataSet when specifically describing ASP.NET features.
Now, there are even behaviors or extensions available for Dreamweaver to help this. I could create an example I guess and he could just modify the code... for his needs.
Let me know...
r
-
texasrenegade
- Forum Newbie
- Posts: 6
- Joined: Thu Jun 29, 2006 1:16 pm
Ok,
go here
http://localhost/Client_durys/HTML_page ... isplay.php
and click on the link Testing Theory
and see how the pages will have PREV and NEXT for the records.
Is this what you mean?
r
go here
http://localhost/Client_durys/HTML_page ... isplay.php
and click on the link Testing Theory
and see how the pages will have PREV and NEXT for the records.
Is this what you mean?
r
You linked to your localhost sever. You'll need to post an IP address or transfer the files to a servertexasrenegade wrote:Ok,
go here
http://localhost/Client_durys/HTML_page ... isplay.php
and click on the link Testing Theory
and see how the pages will have PREV and NEXT for the records.
Is this what you mean?
r
-
texasrenegade
- Forum Newbie
- Posts: 6
- Joined: Thu Jun 29, 2006 1:16 pm