// array counter
foreach ($_REQUEST['hid-rsip'] as $IP) {
    // fix the multiple ipaddresses for use!
    $ipname = $_REQUEST['hid-rsipname'][$ipcounter];
    $ip_addresses[$ipname] = $IP;
    $ipaddresforform[$ipcounter] = array($IP, $ipname);
    $ipaddr .= $IP . ' <em>' . $ipname . '</em> <br/>';
    $ipcounter++;
}
require_once "../libs/console_data_apikey.php";
// bootstap the API.
$Request = array("label" => $label, "ip_addresses" => $ip_addresses);
// array for changes
$JsonRequest = json_encode($Request);
$Url = "entities/" . trim($entityid);
$JsonResponse = Request::postAuthenticatedPutRequest($Url, $Auth, $JsonRequest);
$Response = json_decode($JsonResponse);
$LastCode = Request::getLastHTTPCode();
if ($LastCode == "204") {
    $res = 'ok';
    $msg = '<div class="alert alert-success"><button class="close" data-dismiss="alert">×</button><strong>Update Sucessful!</strong><br />Your changes have been saved.</div>';
    $ok = '<td>
				<form id="From-' . $entityid . '">
					<input type="hidden" name="d" value="tab" />
					<input type="hidden" name="i" value="sve" />
					<input type="hidden" name="update" value="yep" />
					<input type="hidden" name="entityid" value="' . $entityid . '" />
					<input type="hidden" name="rslabel" value="' . $label . '" />';
    $ok .= '<input type="hidden" name="rsip" value=' . "'" . serialize($ipaddresforform) . "' />";
    $ok .= '</form>
				</td><td>' . $entityid . '</td><td>' . $label . '</td><td>' . $ipaddr . '</td>';