Location: PHPKode > projects > TLD Manager > tldmgr/domain_contacts.php
<? include("include/verify.php"); 
	if ((!$domain) || (!$TLD)) {
		$domain = $_COOKIE["domain"];
		$TLD = $_COOKIE["TLD"];
	}
	if ((!$domain) || (!$TLD)) {
		header("Location: domain_pick.php");
	}	
?><html>
<head>
	<title>Contact Info</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['email[" + num + "]'].value=''");
		}
	</script>
</head>

<body>
<form name=frm method="post" action="domain_contacts_update.php">
<input type="hidden" name="user_nick" value="<? echo $user_nick; ?>">
<?
	$HEAD = "Contact&nbsp;Info";
	$INFO = "$domain.$TLD";
	$FOOT[0] = "type='button' value='DONE' onclick='location.href=\"domain_menu.php\"' $seperator";
	$FOOT[1] = "type='button' value='LOGOFF' onclick='location.href=\"logout.php\"'";
	$FOOT[2] = "type='button' value='EDIT MY&#10;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\"");
	$query = "SELECT contact FROM domain WHERE name='$domain' AND TLD='$TLD'";
	if (($user_level & 2) == 0) { $query .= " AND owner='$user_nick'"; }
	$result = mysql_query($query);
	if (mysql_numrows($result) > 0) { $contact = mysql_result($result,0,"contact"); }

	include("header.php");
?>

					<table width=100% cellspacing=0 cellpadding=3 class="form" style="border:1px solid #808080;">
						<tr>
							<td class="form2">REFERENCE</td>
							<td class="form2">EMAIL ADDRESS</td>
							<td></td>
						</tr>
<?
	$count=0;
	while ($contact) {
		$x = strpos($contact, "||");
		if ($x==0) { $x=strlen($contact)+1; }
		$y = strpos($contact, "=");
		$name = substr($contact, 0, $y);
		$email = substr($contact, $y+1, $x-$y-1);
		$contact = substr($contact, $x+2);
?>
						<tr>
							<td><input name=name[<? echo $count; ?>] type="text" size="15" value="<? echo $name; ?>"></td>
							<td><input name=email[<? echo $count; ?>] type="text" size="35" value="<? echo $email; ?>"></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="15" title="Technical Contact"></td>
							<td><input name=email[<? echo $count; ?>] type="text" size="35" title="hide@address.com"></td>
							<td><input type="image" src="images/add.gif"></td>
						</tr>
					</table>

<? include("footer.php"); ?>
Return current item: TLD Manager