<? include("include/verify.php");
$domain = $_COOKIE["domain"];
$TLD = $_COOKIE["TLD"];
if ((!$domain) || (!$TLD)) { header("Location: domain_pick.php"); }
if (!$subdomain) {
$subdomain = $_COOKIE["subdomain"];
} else {
setcookie("subdomain", $subdomain);
}
if (!$subdomain) { header("Location: subdomain_pick.php"); }
?><html>
<head>
<title>Subdomain Nameservers</title>
<link type="text/css" rel="stylesheet" href="domain.css">
<meta http-equiv="refresh" content="<? echo $login_expires+1; ?>">
<script language=JavaScript>
function clear_line(num) {
eval("document.forms[0].elements['name[" + num + "]'].value=''");
eval("document.forms[0].elements['IP[" + num + "]'].value=''");
}
</script>
</head>
<body>
<form name=frm method="post" action="subdomain_ns_update.php">
<input type="hidden" name="user_nick" value="<? echo $user_nick; ?>">
<?
$HEAD = "Subdomain Nameservers";
$INFO = "$subdomain.$domain.$TLD";
$FOOT[0] = "type='button' value='DONE' onclick='location.href=\"subdomain_menu.php\"' $seperator";
$FOOT[1] = "type='button' value='LOGOFF' onclick='location.href=\"logout.php\"'";
$FOOT[2] = "type='button' value='EDIT MY ACCOUNT' onclick='location.href=\"user_edit.php?nick=$user_nick\"'";
$FORM = TRUE;
mysql_connect($db_host,$db_user,$db_pass);
@mysql_select_db($db_name) or die( "Unable to select database \"$db_name @ $db_host\"");
$result = mysql_query("SELECT nameserver FROM subdomain WHERE name='$subdomain' AND parent='$domain.$TLD'");
if (mysql_numrows($result) > 0) { $nameserver = mysql_result($result,0,"nameserver"); }
include("header.php");
?>
<table width=100% cellspacing=0 cellpadding=3 class="form" style="border:1px solid #808080;">
<tr>
<td class="form2">NAME</td>
<td class="form2">IP ADDRESS</td>
<td></td>
</tr>
<?
$count=0;
while ($nameserver) {
$x = strpos($nameserver, "||");
if ($x==0) { $x=strlen($nameserver)+1; }
$y = strpos($nameserver, "=");
$name = substr($nameserver, 0, $y);
$IP = substr($nameserver, $y+1, $x-$y-1);
$nameserver = substr($nameserver, $x+2);
?>
<tr>
<td><input name=name[<? echo $count; ?>] type="text" size="20" value="<? echo $name; ?>"></td>
<td><input name=IP[<? echo $count; ?>] type="text" size="14" value="<? echo $IP; ?>"></td>
<td><input type="image" src="images/delete.gif" onmouseup="clear_line(<? echo $count; ?>);"></td>
</tr>
<?
$count++;
}
?>
<tr>
<td><input name=name[<? echo $count; ?>] type="text" size="20" title="ns.mydomain.com"></td>
<td><input name=IP[<? echo $count; ?>] type="text" size="14" title="127.0.0.1"></td>
<td><input type="image" src="images/add.gif"></td>
</tr>
</table>
<? include("footer.php"); ?>