www.gusucode.com > 凡人网络购物系统 2008源码程序 > regsave.asp

    <!--#include file="conn.asp"-->
<!--#include file="IncAsp/venshop_top.asp"-->
<!--#include file="IncAsp/venshop_email.asp"-->
<!-- #include file="IncAsp/venshop_md5.asp" -->
<div align="center">
<table cellpadding="0" cellspacing="0" class="all_t1">
<tr><td class="all_l_td" valign="top">
<!--#include file="IncAsp/venshop_log.asp"--><div class="d5"></div>
</td>
<td valign="top" class="all_c_td">
<%
if trim(request("user_name"))="" then
    errmsg=errmsg+"<br>"+"<li>用户名不能为空"
    founderr=true
else
    user_name=DelStr(request("user_name"))
end if
if trim(request("user_pass"))="" or trim(request("user_pass2"))="" then
    errmsg=errmsg+"<br>"+"<li>密码或确认不能为空"
    founderr=true
else
    user_pass=md5(DelStr(request("user_pass")))
    user_pass2=md5(DelStr(request("user_pass2")))
end if
if user_pass <> user_pass2 then
    errmsg=errmsg+"<br>"+"<li>两次密码不同"
    founder=true
end if
if isvalidemail(trim(request("user_mail")))=false then
    errmsg=errmsg+"<br>"+"<li>你的E-mail有错误"
    founderr=true
else
    user_mail=DelStr(request("user_mail"))
end if
question=DelStr(request("question"))
answer=DelStr(request("answer"))
set rs=server.createobject("adodb.recordset")
sql="select username from venshop_user where username='"&user_name&"'"
rs.open sql,conn,1,1
if not rs.eof then
    errmsg=errmsg+"<br>"+"<li>用户名已被别人注册"
    founderr=true
end if
rs.close
set rs=nothing
errmes="您好"
%><center>
<table border="0" width="99%" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111">
<%
if founderr=false then
set rs=server.createobject("adodb.recordset")
sql="select * from venshop_user where username='"&user_name&"'"
rs.open sql,conn,1,3
rs.addnew
rs("username")=user_name
rs("userpass")=user_pass
rs("usermail")=user_mail
rs("question")=question
rs("answer")=answer
rs("savemoney")=0
rs("degree")=1
rs("regtime")=now()
rs("landtime")=now()
rs("user_type")=1
rs("user_lastip")=request.servervariables("remote_addr")
rs("user_regip")=request.servervariables("remote_addr")
rs("user_fav")=""
rs.update
rs.close
set rs=nothing


if Request.Cookies("venshop")("guest")<>"" then
guest=Request.Cookies("venshop")("guest")
set rs=server.createobject("adodb.recordset")
rs.open "select user_name from venshop_basket where user_name='"&guest&"' and basket_check=0",conn,1,3
do while not rs.eof
rs("user_name")=request("user_name")
rs.update
rs.movenext
loop
rs.close
set rs=nothing
Response.Cookies("venshop")("guest")=""
end if
Response.Cookies("venshop")("user_name")=user_name
Response.Cookies("venshop")("user_pass")=user_pass
Response.Cookies("venshop")("user_type")=1
mail_regs=replace(replace(replace(replace(mail_regs,"#U",user_name),"#M",user_mail),"#Q",question),"#A",answer)
mail_regc=replace(replace(replace(replace(mail_regc,"#U",user_name),"#M",user_mail),"#Q",question),"#A",answer)
if E_SendManType=1 then
SendEmail ""&user_mail&"",""&mail_regs&"",""&mail_regc&"","Jmail"
elseif E_SendManType=2 then
SendEmail ""&user_mail&"",""&mail_regs&"",""&mail_regc&"","ObjCDOMail"
elseif E_SendManType=3 then
SendEmail ""&user_mail&"",""&mail_regs&"",""&mail_regc&"","Aspemail"
end if
%>
<tr><td class="sort">&nbsp;<IMG src="Skin/<%=venshop_skin%>/home.gif" border=0 align="absmiddle"> 注册成功!</td></tr>
<tr><td align="center">
<table width="90%" border="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111">
<tr><td width="33%" height="30" align="right">用户名:</td><td width="67%" height="30"><%=user_name%></td></tr>
<tr><td width="33%" height="30" align="right">E-mail:</td><td width="67%" height="30"><%=user_mail%></td></tr>
<tr><td width="33%" height="30" align="right">密码保护问题:</td><td width="67%" height="30"><%if question="" then%>没有填写,建议登录之后尽快完善密码保护资料,以便密码丢失时及时找回。<%else%><%=question%><%end if%></td></tr>
<tr><td width="33%" height="30" align="right">找回密码答案:</td><td width="67%" height="30"><%if answer="" then%>没有填写,建议登录之后尽快完善密码保护资料,以便密码丢失时及时找回。<%else%><%=answer%><%end if%></td></tr>
<tr><td height="100" colspan="2"> <p style="line-height: 150%"><%if E_SendManType<>0 then%>感谢您的注册,系统已经自动发送一份邮件到您的注册邮箱,请查收;<br><%end if%><a href="modify.asp"><font color="#FF0000">请完善您的个人资料,方便以后购物;</font></a><br>
<a href="index.asp">暂不填写,现在返回首页。</a></td></tr></table></td></tr>
<%else%>
<tr><td class="sort">&nbsp;<IMG src="Skin/<%=venshop_skin%>/home.gif" border=0 align="absmiddle"> 注册失败!</td></tr>
<tr><td align="center"><table border="0" width="90%" cellspacing="1"><tr><td height="200"><p style="line-height: 150%"><%=errmsg%></td></tr></table></td></tr>
<%end if%></table></td></tr></table></div><!--#include file="IncAsp/venshop_copy.asp"-->