<?
include("include/config.php");
mysql_connect($db_host,$db_user,$db_pass);
@mysql_select_db($db_name) or die( "Unable to select database \"$db_name @ $db_host\"");
$domain = $_COOKIE["domain"];
$TLD = $_COOKIE["TLD"];
if ((!$domain) || (!$TLD)) { header("Location: domain_pick.php"); }
$subdomain = $_COOKIE["subdomain"];
if (!$subdomain) { header("Location: subdomain_pick.php"); }
$nameserver="";
for ($c=0; $c<count($name); $c++) {
if (($name[$c]) || ($IP[$c])) {
$nameserver .= "||" . $name[$c] . "=" . $IP[$c];
}
}
$nameserver = substr($nameserver, 2);
$result = mysql_query("UPDATE subdomain SET nameserver='$nameserver' WHERE name='$subdomain' AND parent='$domain.$TLD'");
mysql_close();
header("Location: subdomain_ns.php");
?>