If I enter http://localhost/sitename?filter=city I would like to display all the cities in xml format
I would like the xml display in tag format like this
<city>
<navi mumbai>
<pune>
</city>
If I enter http://localhost/sitename?filter=city I would like to display all the cities in xml format
I would like the xml display in tag format like this
<city>
<navi mumbai>
<pune>
</city>
Here is sample php code , run this code with your link as filter as your condition
Header("Content-type: text/xml");
// get query string params
$filter = $_GET['filter'];
$xml = '';
If ($filter == "city"){
$xml = $xml . '<continent name="city">';
$xml = $xml . '<city id="1">Navi Mumbai</city>';
$xml = $xml . '<city id="2">Thane</city>';
$xml = $xml . '<city id="3">Pune</city>';
$xml = $xml . '</continent>';
}else If ($filter == "country"){
$xml = $xml . '<continent name="country">';
$xml = $xml . '<country id="100">India</country>';
$xml = $xml . '</continent>';
}else If ($filter == "state"){
$xml = $xml . '<continent name="state">';
$xml = $xml . '<state id="300">Maharastra</state>';
$xml = $xml . '</continent>';
}else{
$xml = $xml . '<continent name="none">';
$xml = $xml . '<country id="0">no result found</country>';
$xml = $xml . '</continent>';
}
// send xml to client
echo( $xml );
?>