<!--#include file="main.asp" -->
<!--#include file="Include/md5.asp" -->
<%
username=request("username")
Password=request("Password")
realname=request("realname")
coname=request("coname")
Email=request("Email")
addone_id=request("addone_id")
addtwo_id=request("addtwo_id")

set rs=Server.CreateObject("Adodb.Recordset")
rs.Open "Select *  from T_Member where F_UserName='"&username&"' or F_coname='"&coname&"'",conn
if not rs.EOF then
Response.Write "<script>alert('用户注册出错，下面是产生错误的可能原因：\n\n·对不起，该用户名或主页名称已经存在，请重新选择');history.go(-1);</Script>"
Response.End   
end if
set rs=Server.CreateObject("Adodb.Recordset")
sql="select *  from T_Member"
rs.open sql,conn,1,3
rs.addnew
rs("F_UserName")=username
rs("F_Password")=md5(Password)
rs("F_RealName")=realname
rs("F_coname")=coname
rs("F_Email")=Email
rs("F_ypaddone")=addone_id
rs("F_ypaddtwo")=addtwo_id
rs("F_co")="co"
rs.update
rs.close
sql1="Select *  from T_Member where F_UserName='"&username&"'"
set rs1=server.createobject("adodb.recordset")
rs1.open sql1,conn,1,1
 Response.Cookies("aspxnet")("CurUserID") =rs1("F_id")
 Response.Cookies("aspxnet")("CurUserName") = username
 Session.Contents("OnlinUserName") = username
   '个人主页
		  session("co")=rs1("F_co")
          session("goname")=rs1("F_UserName")
		  if rs1("T_pic")<>"" then
          session("pic")=rs1("T_pic")
		  else 
		  session("pic")="images/123.jpg"
		  end if
          session("goid")=rs1("F_ID")
          session("coname")=trim(rs1("F_coname"))
		  session("name")=rs1("F_realName")
rs1.close
set rs=nothing
Response.Redirect "index.asp"
%>