Please excuse my newness. Currently I know how to execute a php script by simply naming the script [filename].php and browsing to that file on my webserver. I have also learned how to parse and display an xml file using php. What I want to do is have a .xml file like:
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
</bookstore>
Current I can display all of the information like:
<?php
$xml = simplexml_load_file("test.xml");
echo $xml->getName() . "<br />";
foreach($xml->children() as $child)
{
foreach($child->children() as $subchild)
{
echo $subchild->getName() . ": " . $subchild . "<br />";
}
}
?>
But instead, what I want to do is on one page, say bookstore.html, list all of the book titles. Then if I click on a book title, I want to display a new page with all of the information about that book. The only way I can figure out to do this is to manually make a [booktitle].php for each book, but that is completely defeating the purpose of using xml :)
Can anyone point me in the right direction?
Thanks,
David