%dim action
action=FormatSQL(SafeRequest("action",0))
userfrom=FormatSQL(SafeRequest("from",0))
'----------------------------------------------------------------------------------
'----------------------------------------------------------------------------------
'----------------------------------------------------------------------------------
%>
<%=webname%> ---- 新用户注册
<%
select case action
case ""%>
<%case "save"%>
<%call saveuser()%> <%
end select%>
<%
sub saveuser()
dim rsrec,strgift,stradd,strresult
select case userfrom '判断用户是从哪里注册
case "cars51" '从cars51上注册的
if session("regtimes")=1 then
response.Write "
对不起,您刚注册过用户。
请稍后再进行注册!
"
response.End
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select username,useremail from [user] where username='"&trim(request.form("username"))&"' or useremail='"&trim(request.form("useremail"))&"'",conn,1,1
if not rs.eof and not rs.bof then
call usererr()
rs.close
set rs = nothing
response.end
else
rs.close
rs.open "select webimg13 from [config]",conn,1,1
strgift=Clng(rs("webimg13"))
rs.close
stradd=trim(request.form("recommender"))
if stradd <>"" then
rs.open "select score from [user] where username='"&stradd&"' ",conn,1,3
if rs.eof and rs.bof then
strresult="您填写的推荐人名称尚未注册!"
stradd="admin"
else
strresult="给你的推荐人 "& stradd & "加了 "& strgift &" 分!"
rs("score")=rs("score")+strgift
rs.update
end if
rs.close
end if
rs.open "select * from [user]",conn,1,3
rs.addnew
rs("username")=trim(request.form("username"))
rs("UserPassword")=trim(request.form("UserPassword"))
rs("useremail")=trim(request.form("useremail"))
strcarstype=Trim (Request.Form ("county"))
'if strcarstype="" then
'strcarstype=Trim (Request.Form ("carstype1"))
if Trim (Request.Form ("carstype1"))<>"" then
strcarstype=Trim (Request.Form ("carstype1"))
end if
if Trim (Request.Form ("cars"))="" then
rs("cars")=0
rs("carstype")=strcarstype
else
rs("cars")=Trim (Request.Form ("cars"))
rs("carstype")=""
end if
rs("recommender")=stradd
rs("adddate")=now()
rs("LastLogin")=now()
rs("vip")=2
rs("disable")=0
rs.update
rs.close
set rs=nothing
'发送邮件所需
strEmail = Replace (Trim (Request.Form ("userEmail")), "'", "''")
strusername=request.form("username")
strpassword=trim(request.form("UserPassword"))
end if
end select
response.Cookies("timesshop")("username")=strusername
Response.Cookies("timesshop").Expires = Now()+1
Response.Cookies("timesshop")("vip")=2
if strEmail<>"" then
' ===========================================
' 下面是利用JMail 组件发送信息的代码
'
' ==================================
'strmailcontent=" " & strCompany & " 感谢您在PANTONE中国网注册(http://www.pantonechina.com)
"
'strmailcontent=" " & strmailcontent & " 您的注册信息如下:
"
'strmailcontent=strMailContent & "用户名:" & strUserName & "
"
'strmailcontent=strMailContent & "密 码:" & strpassword & "
"
'strmailContent = strmailContent & " PANTONE中国真诚为您服务……
" & vbCrlF
'strmailContent = strmailContent & "
"
strmailcontent=strMailContent & ""&strusername&",您好:
"
strmailcontent=strMailContent & "欢迎您注册成为PANTONE国际色卡网(http://www.pantonechina.com)PANTONE国际色卡网 会员,我们将为您提供优质的商品和服务! 以下是您的注册信息:
用户名 :"&strusername
strmailcontent=strMailContent & " 密 码:"&strpassword&" 注册邮箱:"& strEmail & "
您忘记密码时可以凭此找回,请您牢记此信息!
"
strmailcontent=strMailContent & "* 前往国际色卡网 首页 ----------- http://www.pantonechina.com "
strmailcontent=strMailContent & "* 查看国际色卡网的帮助文档 ----- 帮助文档 "
strmailcontent=strMailContent & "* 直接登录您的会员中心 ------- 我的会员中心
"
strmailcontent=strMailContent & " 再次感谢您注册PANTONE国际色卡网,祝您购物愉快!  |
"
strMailSubject="您在国际色卡网的注册信息!"
'strEmail = Replace (Trim (Request.Form ("userEmail")), "'", "''")
'strusername=request.form("username")
'strpassword=trim(request.form("UserPassword"))
strformmail="sales@pantonechina.com"
'Call SendMail (strUserName,strEmail,strformmail,"您在PANTONE中国的注册信息!", strMailContent)
Set JMail = Server.CreateObject ("JMail.SMTPMail")
JMail.Lazysend = True
JMail.MailDomain = "211.100.8.162"
JMail.Charset = "gb2312"
JMail.ContentType ="text/html"
JMail.Sender = "sales@pantonechina.com"
JMail.SenderName = "国际色卡网"
JMail.ReplyTo = "sales@pantonechina.com"
'JMail.ReturnReceipt = True
JMail.Subject = strMailSubject '主题
JMail.ClearRecipients ()
JMail.AddRecipient stremail '收件人
'JMail.AddRecipientBCC "service@cars51.cn" '暗送
JMail.Body = strmailcontent '邮件内容
JMail.Priority = 1
JMail.AddHeader "Originating-IP", Request.ServerVariables ("Remote_Addr")
JMail.Execute () ' 发送Email
JMail.Close ()
Set JMail = Nothing
end if
%>
>
>
>
恭喜 <% = request.Cookies("timesshop")("username") %> ,注册成功!
您已注册成为[
<% = webname %>
]正式用户,
请进行下一步操作:
注:我们已将一封包含有您的用户名和密码的邮件发送到您所注册的邮箱中,请查收并妥善保管,以备不时之需。 <% = strresult %>
·为了方便您的购物,建议您填写详细的收货人资料
·更多的了解本网,请点此查看帮助!
<% = sendmsg %>
·返回商城首页
|
|
<%
'end if
end sub
sub usererr() %>
>
很抱歉,注册失败! |
失败原因:
·您输入的用户名或Email地址已经被注册,请选用其他的用户名或者E-mail地址!
·点击返回上一页
|
|
<%
end sub
%>