topical media & game development
professional-ria-04-helloResponsev2.php / php
<?php
/*
Second version of helloResponse.php.
This version includes:
- lookupMessage enhanced to provide an XML formatted response.
*/
header('Content-Type: text/xml');
function lookupMessage(mCountry == "France")
return 'Bonjour Monde!';
else if (mCountry == "Spain")
return 'Hola Mundo!';
else if (mCountry)
{
if (mCountry == "Germany")
return 'Ray';
else if (mCountry == "USA")
return 'Jonathan';
else
return 'Unknown Sender!';
}
?>
<?xml version="1.0" encoding="UTF-8"?>
<response>
<sender><?php echo lookupSender(_GET['country'])?></message>
</response>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.