Exemple #1
0
    session_start();
}
// Start the session
$Allocate = new Allocate();
//instantiating class with DB functions
$action = $_REQUEST["action"];
//variable from GET string - shows what action to take
header("Content-type:text/xml");
//setting the content type of the response document to XML
echo '<?xml version="1.0"?><data>';
//setting the root xml tag in the response document
switch ($action) {
    case "AddIP":
        $status = $Allocate->AddIP($_REQUEST['pkIPTableIP']);
        //
        echo '<status><![CDATA[' . $status[0] . ']]></status>';
        //output login status
        echo '<Name><![CDATA[' . $status[1] . ']]></Name>';
        //output login status
        break;
    case "AddIPs":
        $status = $Allocate->AddIPs($_REQUEST['IPBlock'], $_REQUEST['SubNet'], $_REQUEST['Gateway'], $_REQUEST['UsableFrom'], $_REQUEST['UsableTo']);
        //
        echo '<status><![CDATA[' . $status[0] . ']]></status>';
        //output login status
        echo '<Name><![CDATA[' . $status[1] . ']]></Name>';
        //output login status
        break;
}
echo "</data>";
//finish xml