<?php
  
// Example of an XML back end for Rico (http://www.openrico.org) AJAX
  // functionality.
  // Rico doesn't care what language you use to write this: only the input
  // and the output matters.
  //
  // Placed in the public domain by John Hartnup 2006

  
header('Content-type: text/xml'); 
  
  
$descriptions = array( 'Mars' => 'A red planet inhabited by dwarves',
                         
'Venus' => 'A purple gassy planet');

  
$html "Empty planet request.";
  
$planet $_REQUEST['planet'];
  if(
$planet) {
     
$html $descriptions[$planet
             ? ( 
$planet ": " $descriptions[$planet] )
         : (
"Nothing is known about $planet");
  }

?>

<ajax-response>
  <response type="element" id="planetDesc">
       <?php echo $html?>
  </response>
</ajax-response>