<?
if(isset($_POST["submit"]))
{
	if(preg_match("/^([a-z0-9-]+){3,32}/i",$_POST["uname"]) && preg_match("/^([a-z0-9-]+){3,32}/i",$_POST["pwd"])
		&& preg_match("/([0-1]){1}/",$_POST["sex"]) && preg_match("/^([a-z0-9-]+){3,32}/i",$_POST["phint"]))
	{
		$con = odbc_connect("TotalDB", "YOUR_WINDOWS_ACCOUNT_NAME", "WINDOWS_ACCOUNT_PASSWD");
		$result = odbc_exec($con, "SELECT MAX(id_index) AS 'maxid' FROM chr_log_info");
		$row = odbc_fetch_array($result);
		$maxid = $row["maxid"]+1;
		$result = odbc_exec($con, "INSERT INTO chr_log_info (id_index, login_id, passwd, passwd_hint, d_sex, d_jumin, d_kyulje, bill_point)
									VALUES({$maxid}, '{$_POST['uname']}', '{$_POST['pwd']}', '{$_POST['phint']}', '{$_POST['sex']}', '666-666', 319, 30)");
		odbc_close($con);
		print "Account created...";
	}
}
?>
<html>
<head>
	<title>DR Reg</title>
</head>
<body>
<form action="" method="post">
Name: <input type="text" name="uname" id="uname" /><br />
Password: <input type="text" name="pwd" id="pwd" /><br />
Sex <select name="sex" id="sex">
		<option value="0">Male</option>
		<option value="1">Female</option>
	</select><br />
Password-"hint": <input type="text" name="phint" id="phint" /><br />
<input type="submit" name="submit" value="Register" />
</form>
</body>
</html>