if
(
$rows
> 0){
echo
"<script type='text/javascript'>alert('用户名已存
在
');location='javascript:history.back()';</script>";
}
else
{
$user_in
= "insert into user_info (username,pass,sex,qq,email,img) values
('$_POST[username]',md5('$_POST[pass]'),'$_POST[sex]','$_POST[qq]','$_POST[email]','$_POS
T[img_select]')";
//echo $user_in;
mysql_query(
$user_in
);
echo
"<script type='text/javascript'>alert('写入成功!!');location.href='login.php';</script>";
}
//javascript:history.go(-1)
}
?>
<form action="reg.php" name="reg_form" method="post" onsubmit="return check_reg()">
<table name="reg_table" align="left">
<tr>
<td>用户:</td><td><input id="username" name="username"
class
="myText" type="text"
maxlength="12" /></td>
</tr>
<tr> <!--性别:0 保密 1 女 2 男-->
<td > 性别:</td>
<td>女<input type="radio" value="1" name="sex"/>
男
<input type="radio" value="2" name="sex" />
保密
<input type="radio" value="0" name="sex" checked/></td>
</tr>
<tr>
<td>密码:</td><td><input name="pass"
class
="myText" type="password"
onblur="check_len(this)"/><span id="show_pass" style="color:red;"></span></td>
</tr>
<tr>
<td>重复密码:</td><td><input name="repass"
class
="myText" type="password"
onblur="check_pass(this)" /><span id="show_repass" style="color:red;"></span></td>
</tr>
<tr>
<td>QQ:</td><td><input type="text"
class
="myText" name="qq"
onblur="check_qq(this)"/><span style="color:red;" id="show_qq"></span></td>
</tr>
<tr>
<td>邮箱:</td><td><input type="text"
class
="myText" name="email"
onblur="check_email(this)"/><span id="show_e" style="color:red;"></span></td>
</tr>
<tr>
<td height="60">头像:</td>