<!--#include file="conn.asp"-->
<%
userid=trim(request("signup_uid"))
set rs=server.createobject("adodb.recordset")
sqltext="select * from userinfo where userid='"&userid&"'"
rs.open sqltext,conn,3,3

if not rs.eof and not rs.bof then
		Response.Redirect "messagebox.asp?msg=此用户名已经注册过，请选用其他用户名!"
else
'添加一条记录到数据库
rs.addnew
rs("userid")=request.form("signup_uid")
rs("userpwd")=request.form("signup_pwd")
rs("email")=request.form("signup_email")
rs("sex")=request.form("signup_gender")
rs("username")=request.form("signup_username")
rs("tel")=request.form("signup_tel")
rs("age")=request.form("signup_age")
rs("address")=request.form("signup_addr")
if request.form("signup_aihao")="" then
	rs("aihao")=""
else
	rs("aihao")=request.form("signup_aihao")
end if

if request.form("signup_danwei")="" then
	rs("danwei")=""
else
	rs("danwei")=request.form("signup_danwei")
end if
rs("dateandtime")=now()
rs.update
session("loginusername")=request.form("signup_uid")
response.redirect "Message.asp"
rs.close
conn.close
end if
%>