Location: PHPKode > projects > Total ISP > total-isp/domainadd.php
<?
#somehow this interferes with the header?
include "./auth.inc.php";
$pieces=split(":",$existacc);
$existacc=$pieces[0];
if (!$VISP)
	$VISP=$pieces[1];

if (!ereg("\.com|\.net|\.asn|\.org|\.gov",$domain)){
	print "$domain does not appear to be a valid domain name.";
	exit;
}
if (!$CustomerID){
	print "Customer ID error.";
	exit;
}
if (!$existacc){
	print "Account ID Error.";
	exit;
}
if (!$VISP){
	print "VISP Error";
	exit;
}

#here goes..
if ($approved){
	$isql="INSERT INTO SubAccounts(
	CustomerID,Login,AccountType,VISP,AliasID,SubExpire,nomail
	)VALUES(
	'$CustomerID','$domain','DomainAlias','$VISP','$existacc',
	DATE_ADD(now(),INTERVAL 1 YEAR),1
	)";

	include "./mysql.inc.php";
	mysql_query($isql);
	if (strlen(mysql_error())>3){
		print "what?";
		print mysql_error();
	}
	include "./lm.inc.php";
	$message=urlencode("* Domain Added");
	$purchase=urlencode("* Domain Alias");
	header("Location: addtime.php?purchase=$purchase&cost=0&message=$message");
	exit;
}
print ".";
?><FORM>
Add Domain <B><? echo $domain; ?></B> to Account: <? echo $existacc; ?>.
<input type=hidden name="VISP" value="<? echo $VISP ?>">
<input type=hidden name=domain value="<? echo $domain ?>">
<input type=hidden name=existacc value="<? echo $existacc ?>">
<input type=hidden name=approved value="1">
<input type=submit value="Add Domain">
</FORM>
Return current item: Total ISP