Marius Cramer
2015-08-06 37b29231e47a0c4458dc1c15d98588f16f07e1e2
commit | author | age
413d3b 1 <?php
T 2
b1a6a5 3 require 'soap_config.php';
413d3b 4
T 5
6 $client = new SoapClient(null, array('location' => $soap_location,
b1a6a5 7         'uri'      => $soap_uri,
MC 8         'trace' => 1,
9         'exceptions' => 1));
413d3b 10
T 11
12 try {
b1a6a5 13     if($session_id = $client->login($username, $password)) {
413d3b 14         echo 'Logged successfull. Session ID:'.$session_id.'<br />';
T 15     }
b1a6a5 16
413d3b 17     //* Set the function parameters.
T 18     $client_id = 1;
19     $params = array(
b1a6a5 20         'server_id' => 1,
MC 21         'zone' => 3,
22         'name' => 'cname',
23         'type' => 'cname',
24         'data' => 'hostmachine',
25         'aux' => '0',
b41803 26         'ttl' => '3600',
b1a6a5 27         'active' => 'y',
MC 28         'stamp' => 'CURRENT_TIMESTAMP',
29         'serial' => '1',
30     );
31
413d3b 32     $id = $client->dns_cname_add($session_id, $client_id, $params);
T 33
34     echo "ID: ".$id."<br>";
b1a6a5 35
413d3b 36     if($client->logout($session_id)) {
T 37         echo 'Logged out.<br />';
38     }
b1a6a5 39
MC 40
413d3b 41 } catch (SoapFault $e) {
T 42     echo $client->__getLastResponse();
43     die('SOAP Error: '.$e->getMessage());
44 }
45
46 ?>