<?php
require_once("./ArrayToXML.class.php");
// Setup Server
$server = new ArrayToXMLServer( $HTTP_RAW_POST_DATA );
$requestArray = $server->getRequestArray();
// Run Commands
switch($requestArray['command'])
{
case "getServerTime":
$response = date("G:i");
break;
case "getDayOfTheWeek":
$response = date("l");
break;
default:
$response = "Command not found";
break;
}
$responseArray['response'] = $response;
// Send Response Array
$server->sendResponse($responseArray);
|