⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 user_register2.asp

📁 WAP网上购物系统源程序,,有兴趣的朋友,一起研究一下..交流经眼
💻 ASP
字号:
<!--#include file=INC/skin.asp-->
<!--#include file=INC/txl_userfun.asp-->
<!--#include file=INC/user_mail_fun.asp-->


<%
dim emailstr
emailstr=""
emailstr=emailstr&"<style>"&vbcrlf
emailstr=emailstr&"td{font-size:9pt;line-height:120%;color:#353535} "&vbcrlf
emailstr=emailstr&"body{font-size:9pt;line-height:120%} "&vbcrlf
emailstr=emailstr&"a:link          { color: #000000; text-decoration: none }"&vbcrlf
emailstr=emailstr&"a:visited       { color: #000000; text-decoration: none }"&vbcrlf
emailstr=emailstr&"a:active        { color: #000000; text-decoration: none }"&vbcrlf
emailstr=emailstr&"a:hover         { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }"&vbcrlf
emailstr=emailstr&"</style>"&vbcrlf
'on error resume next
dim const_txl_HomeUrl,errstr,GBL_CHK_TempStr,mailsendfalg
errstr=""
const_txl_HomeUrl=""
if session("usertype")="" Then Response.Redirect const_txl_HomeUrl&"index.asp"
OpenDatabase
txl_SiteHead const_txlname&"-首页"
call online
call main
CloseDatabase
web_end
sub main
	if outsitesubmit	then
		 printerror "注册出错","<li>请不要从外部提交数据!</li>",779
	else
		dim registerusername,registersname
		registerusername=Request.form("txl_username")
		registersname=Request.form("txl_truename")
		if not checkfrmusername(registerusername) then	'过滤注册名非法字符
			printerror "注册出错","<li>"&GBL_CHK_TempStr&"</li>",779
		else	'继续执行注册程序
			if not checkusername(registerusername) then
				printerror "注册出错","<li>用户名"&registerusername&" 已经被别人注册,请换别的用户名</li>",779
			else			
			if not checksname(registersname) then
				printerror "注册出错","<li>姓名"&registersname&"已经被别人注册,请换别的姓名</li>",779
			else
				if not checkregisterdata then	'注册信息检测
					printerror "注册出错","<li>"&GBL_CHK_TempStr&"</li>",779
				else
					call saveregisterdata
					GBL_CHK_TempStr="<li>注册成功,"
					if const_welcomemessage=1 then
						sendpermsg "admin",registerusername,const_txlname&"欢迎您的到来",getmsgwelcomecontent,now()
						GBL_CHK_TempStr=GBL_CHK_TempStr&"系统短信发送成功!</li>"
					end if
					if const_welcomeemail=1 then		'开启邮件发信欢迎新用户功能
						select case const_emailmode
							case 0:
							case 1:
								mailsendfalg=SendJmail(Trim(Request.form("txl_email")),const_txlname&"欢迎你的到来",getmailwelcomecontent,const_adminemail)
								if mailsendfalg=0 then
									GBL_CHK_TempStr=GBL_CHK_TempStr&"<li>服务器不支持Jmail组件,系统发Mail失败</li>"
								elseif mailsendfalg=1 then
									GBL_CHK_TempStr=GBL_CHK_TempStr&"<li>系统发Mail成功</li>"
								elseif mailsendfalg=2 then
									GBL_CHK_TempStr=GBL_CHK_TempStr&"<li>系统发Mail失败</li>"
								end if
							case 2 
								mailsendfalg=SendCDOMail(Trim(Request.form("txl_email")),const_txlname&"欢迎你的到来",getmailwelcomecontent,const_adminemail)
								if mailsendfalg=0 then
									GBL_CHK_TempStr=GBL_CHK_TempStr&"<li>服务器不支持CDOMail组件,系统发Mail失败</li>"
								elseif mailsendfalg=1 then
									GBL_CHK_TempStr=GBL_CHK_TempStr&"<li>系统发Mail成功</li>"
								elseif mailsendfalg=2 then
									GBL_CHK_TempStr=GBL_CHK_TempStr&"<li>系统发Mail失败</li>"
								end if
							case 3:
								mailsendfalg=SendEasyMail(Trim(Request.form("txl_email")),const_txlname&"欢迎你的到来",getmailwelcomecontent,getmsgwelcomecontent,const_adminemail)
								if mailsendfalg=0 then
									GBL_CHK_TempStr=GBL_CHK_TempStr&"<li>服务器不支持EasyMail组件,系统发Mail失败</li>"
								elseif mailsendfalg=1 then
									GBL_CHK_TempStr=GBL_CHK_TempStr&"<li>系统发Mail成功</li>"
								elseif mailsendfalg=2 then
									GBL_CHK_TempStr=GBL_CHK_TempStr&"<li>系统发Mail失败</li>"
								end if
						end select
					end if
						printsuc "恭喜您,注册成功",GBL_CHK_TempStr,779
				end if
				'继续执行Wap影音注册程序
			end if
			end if
		end if
	end if
end sub

Rem		Wap影音注册信息检测 
function checkregisterdata()
	dim username,password,email,truename,question,answer
	username=Trim(Request.Form("txl_username"))
	password=Trim(Request.Form("txl_password1"))
	email=Trim(Request.Form("txl_email"))
	truename=Trim(Request.Form("txl_truename"))
	question=Trim(Request.Form("txl_question"))
	answer=Trim(Request.Form("txl_answer"))
	if username="" or password="" or email="" or truename="" or question="" or answer="" then 
		GBL_CHK_TempStr="注册信息不完整,以下项目是必填项目:用户名,密码,邮箱,真实姓名,密码提示问题,密码提示答案"
		checkregisterdata=false
	else
		checkregisterdata=true
	end if
end function

Rem 得到mail主体信息
function getmailwelcomecontent()
	dim temp,temp2
	temp=emailwelcome
	temp=Replace(temp,"{username}",Trim(Request.form("txl_username")))
	temp=Replace(temp,"{txlname}",const_txlname)
	temp=Replace(temp,"{txlurl}",const_homepageurl)
	temp2="<html>"&vbcrlf
	temp2=temp2&"<body>"&vbcrlf
	temp2=temp2&emailstr&vbcrlf
	temp2=temp2&temp&vbcrlf
	temp2=temp2&"<br>注意:以下是您的注册用户名和密码,请妥善保管:<br>"&vbcrlf
	temp2=temp2&"用户名:<font color='red'>"&Trim(Request.Form("txl_username"))&"</font><br>"&vbcrlf
	temp2=temp2&"密码:<font color='red'>"&Trim(Request.Form("txl_password1"))&"</font><br>"&vbcrlf
	temp2=temp2&"<div align='right'>"&const_adminname&"<br>"&now()&"</div><br>"
	temp2=temp2& "<table width='500' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#ffffff'>"&vbcrlf
  	temp2=temp2& "	<tr>"&vbcrlf 
	temp2=temp2& "		<td height=8></td>"&vbcrlf
  	temp2=temp2& "	</tr>"&vbcrlf
  	temp2=temp2& "	<tr>"&vbcrlf 
   	temp2=temp2& "		<td  style='border:#e6e6e6 1px solid;font-size:12px;text-align:center;line-height:1.8;'>"&vbcrlf
    temp2=temp2& 			const_copyright&vbcrlf
    temp2=temp2& 			"<br>"&vbcrlf
    temp2=temp2& "		Copyright &copy;2003 <a href='http://www.81238.net' target='_blank'><font face=Verdana, Arial, Helvetica, sans-serif style=font-size:10px><b>葛洲坝高级中学<font color=#CC0000>2003届2班</font></b></font></a>  Powered by :<a href=http://www.81238.net/class2 target=_blank title='Wap影音'><font color=gray style='text-DECORATION: none'> V2.0</font></a>"&vbcrlf
    temp2=temp2& "		</td>"&vbcrlf
  	temp2=temp2& "	</tr>"&vbcrlf
	temp2=temp2& "</table>"&vbcrlf
	temp2=temp2&"</html>"&vbcrlf
	getmailwelcomecontent=temp2
end function

Rem 得到msg主体信息
function getmsgwelcomecontent()
	dim temp
	temp=msgwelcome
	temp=Replace(temp,"{username}",Trim(Request.form("txl_username")))
	temp=Replace(temp,"{txlname}",const_txlname)
	getmsgwelcomecontent=temp
end function

sub saveregisterdata
	dim username,password,email,truename,question,answer
	dim oicq,homephone,homeaddr,homezip,newphone,newaddr
	dim newzip,sex,userpic,FaceUrl,FaceWidth,FaceHeight
	dim byear,bmonth,bday,ubbsign


	username=Trim(Request.Form("txl_username"))
	password=Trim(Request.Form("txl_password1"))
	email=Trim(Request.Form("txl_email"))
	truename=Trim(Request.Form("txl_truename"))
	question=htmlEncode(Trim(Request.Form("txl_question")))
	answer=htmlEncode(Trim(Request.Form("txl_answer")))

	oicq=Trim(Request.Form("txl_oicq"))
	homephone=Trim(Request.Form("txl_homephone"))
	homeaddr=Trim(Request.Form("txl_homeaddr"))
	homezip=Trim(Request.Form("txl_homezip"))
	newphone=Trim(Request.Form("txl_newphone"))
	newaddr=Trim(Request.Form("txl_newaddr"))
	
	newzip=Trim(Request.Form("txl_newzip"))
	sex=Trim(Request.Form("txl_sex"))
	userpic=Trim(Request.Form("txl_userpic"))
	FaceUrl=Trim(Request.Form("txl_FaceUrl"))
	FaceWidth=Trim(Request.Form("Form_FaceWidth"))
	FaceHeight=Trim(Request.Form("Form_FaceHeight"))
	byear=Trim(Request.Form("txl_byear"))
	bmonth=Trim(Request.Form("txl_bmonth"))
	bday=Trim(Request.Form("txl_bday"))
	ubbsign=htmlEncode(Trim(Request.Form("txl_Underwrite")))
	dim rs
	set rs=Server.CreateObject("Adodb.Recordset")
	rs.open "select * from ec where 1=2",conn,1,3
	rs.addnew()
		rs("studentid")=username
		rs("password")=password
		rs("sname")=truename
		rs("sex")=sex
		rs("oicq")=oicq
		rs("email")=email
		rs("homephone")=homephone
		rs("homeaddr")=homeaddr
		
		rs("regtime")=now()
		rs("homezip")=homezip
		rs("newphone")=newphone
		rs("newaddr")=newaddr
		rs("newzip")=newzip
		rs("pwdquest")=question
		rs("pwdanswer")=answer
		rs("logintimes")=0
		rs("pic")=FaceUrl
		rs("forumtimes")=0
		rs("lastedtime")=now()
		rs("birthday")=byear&"-"&bmonth&"-"&bday
		rs("picwidth")=Clng(FaceWidth)
		rs("picheight")=Clng(FaceHeight)
		rs("sign")=ubbsign
		rs("usertype")=Session("usertype")
		rs("picurl")=FaceUrl
		rs("new_reg_mail_inform")=Request.Form("new_reg_mail_inform")
	rs.update
	rs.close
	set rs=nothing
	Call new_reg_mail_send(username,truename,email)
end sub
Function new_reg_mail_send(username,truename,email)
	Dim temp2,temp,subject,shoujianren
	temp="亲爱的会员,您好!<br>"&Vbcrlf
	temp=temp&"贵Wap影音("&const_txlname&")又有新成员加入:<br><br>"
	temp=temp&"姓名:"&truename&"&nbsp;&nbsp;用户名:"&username&"<br><br>"
	temp=temp&"EMAIL:"&email&"<br><br>"
	temp=temp&"快快去信给他(她)一声问候吧!<br>"
	temp=temp&"如果您不想再收到这样的信件,请去Wap影音取消新用户注册邮件通知!<br>"
	temp=temp&"点击这里登录<a href='"&const_homepageurl&"' target='_blank'>"&const_txlname&"</a>!<br>"
	temp=temp&"<div align='right'>"&const_adminname&"<br>"&now()&"</div><br>"
	temp=temp& "<table width='500' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#ffffff'>"&vbcrlf
  	temp=temp& "	<tr>"&vbcrlf 
	temp=temp& "		<td height=8></td>"&vbcrlf
  	temp=temp& "	</tr>"&vbcrlf
  	temp=temp& "	<tr>"&vbcrlf 
   	temp=temp& "		<td  style='border:#e6e6e6 1px solid;font-size:12px;text-align:center;line-height:1.8;'>"&vbcrlf
    temp=temp& 			const_copyright&vbcrlf
    temp=temp& 			"<br>"&vbcrlf
    temp=temp& "		Copyright &copy;2003 <a href='http://www.81238.net' target='_blank'><font face=Verdana, Arial, Helvetica, sans-serif style=font-size:10px><b>葛洲坝高级中学<font color=#CC0000>2003届2班</font></b></font></a>  Powered by :<a href=http://www.81238.net/class2 target=_blank title='Wap影音'><font color=gray style='text-DECORATION: none'> V2.0</font></a>"&vbcrlf
    temp=temp& "		</td>"&vbcrlf
  	temp=temp& "	</tr>"&vbcrlf
	temp=temp& "</table>"&vbcrlf
	temp2="<html>"&vbcrlf
	temp2=temp2&"<body>"&vbcrlf
	temp2=temp2&emailstr&vbcrlf
	temp2=temp2&temp&vbcrlf
	temp2=temp2&"</html>"&vbcrlf
	subject="好消息,贵Wap影音又增新成员!--"&const_txlname
	shoujianren=""
	dim rs
	set rs=conn.execute ("select email from ec where new_reg_mail_inform=1")
	if not rs.eof then
		while not rs.eof
			shoujianren=shoujianren&rs(0)&","
			rs.movenext
		wend
	else
		shoujianren=""
	end if
	rs.close
	set rs=nothing
	if shoujianren<>"" Then
		select case const_emailmode
			case 0:
			case 1:
				mailsendfalg=SendJmail(shoujianren,subject,temp2,const_adminemail)
			case 2 
				mailsendfalg=SendCDOMail(shoujianren,subject,temp2,const_adminemail)
			case 3:
				mailsendfalg=SendEasyMail(shoujianren,subject,temp2,const_adminemail)
		end select
	end if
End Function



%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -