Пример #1
0
    <form method="post" action=".">
        Source Name:
        <input type="text" size="25" name="sName"/><br/>
        Password:
        <input type="password" size="25" name="password"/><br/>
        SiteID:
        <input type="text" size="5" name="siteID" value="-99"/><br/>
        <input type="submit" value="submit" name="submit"/>
    </form>
<?php 
} else {
    $sourcename = $_POST["sName"];
    $password = $_POST["password"];
    $siteID = $_POST["siteID"];
    // initialize default credentials
    $creds = new SourceCredentials($sourcename, $password, array($siteID));
    $clientService = new MBClientService();
    $clientService->SetDefaultCredentials($creds);
    $result = $clientService->GetClients(array());
    $cdsHtml = '<table><tr><td>ID</td><td>Name</td></tr>';
    $cds = toArray($result->GetClassDescriptionsResult->ClassDescriptions->ClassDescription);
    foreach ($cds as $cd) {
        $cdsHtml .= sprintf('<tr><td>%d</td><td>%s</td></tr>', $cd->ID, $cd->Name);
    }
    $cdsHtml .= '</table>';
    echo $cdsHtml;
}
?>
    </body>
</html>