johnarthouse
Technical User
I have a simple xml file with information for car parks, each has a unique id.
I want the details of one car park to be displayed after clicking on a static html link.
The link looks like:
a sample of the XML file looks like this:
the PHP page contains this:
plus an include for MM_XSLTransform.class.php that Dreamweaver pops in for me.
the XSL file contains
which works great to display the details for carpark ID 4, because 4 is hard coded
SO, what I want to do is have [ID='4'] be whatever ID number is in the link.
So that actually works.
Any help would be gratefully appreciated. It's on a PHP 4.4.9 server
Reply With Quote
I want the details of one car park to be displayed after clicking on a static html link.
The link looks like:
Code:
<a href="detail.php?park=4">Link</a>
a sample of the XML file looks like this:
Code:
<CPINFOWEB>
<CARPARK>
<ID>4</ID>
<CostCode>16</CostCode>
<Name>Old Marylebone Road</Name>
<Address>300 Old Marylebone Road</Address>
<Town>London</Town>
<Postcode>NW1 5RJ</Postcode>
<Telephone>123456</Telephone>
</CARPARK>
</CPINFOWEB>
the PHP page contains this:
Code:
<?php
$mm_xsl = new MM_XSLTransform();
$mm_xsl->setXML("CPINFOWEB-2.xml");
$mm_xsl->setXSL("CPINFOWEB-2.xsl");
echo $mm_xsl->Transform();
?>
plus an include for MM_XSLTransform.class.php that Dreamweaver pops in for me.
the XSL file contains
Code:
<xsl:for-each select="dataroot/CPINFOWEB/CARPARK[ID='4']">
which works great to display the details for carpark ID 4, because 4 is hard coded
SO, what I want to do is have [ID='4'] be whatever ID number is in the link.
So that actually works.
Any help would be gratefully appreciated. It's on a PHP 4.4.9 server
Reply With Quote