asp注册验证码设置,请高手帮忙解决下。
asp注册验证码设置,请高手帮忙解决下。程序代码:
<!--#include file="../inc/head_admin.asp" --> <% rndcode=SafeRequest("rndcode")--------------------------------------------这个是验证的 username=SafeReplace(SafeRequest("username")," ","") userpass1=SafeRequest("userpass1") userpass2=SafeRequest("userpass2") userpass = md5(userpass1) chregister=SafeRequest("chregister") f_chregister=left(chregister,1) l_chregister=mid(chregister,2) enregister = cntopy(f_chregister)&" "&cntopy(l_chregister) mobile=SafeRequest("mobile") chcountry="中国大陆" encountry="China" chprovince=SafeRequest("chprovince") enprovince=SafeRequest("enprovince") chcity=SafeRequest("chcity") if chcity = "" then chcity = chprovince encity = cntopy(chcity) chaddress=SafeRequest("chaddress") enaddress = cntopy(chaddress) postcode=SafeRequest("postcode") telephoneno=SafeRequest("telephoneno") email=SafeRequest("email") faxno=SafeRequest("faxno") if faxno="" then faxno = telephoneno if len(enaddress)>50 then enaddress = left(enaddress,50) QQ =SafeRequest("QQ") certcode=SafeRequest("certcode") if rndcode<>session("LOGIN_RndCode") then response.redirect "../newuserreg?msg=验证码错" end if if username="" or userpass1="" or chregister="" or telephoneno="" or email="" then PopErr "用户注册信息填写不全,请仔细填写" end if if username="system" or username="admin" or username="administrator" then PopErr "该用户已存在,不能注册" end if 'if isInKeepStr(username,session("syscfg-syskeepusername")) =true then PopErr "该会员已存在或系统保留会员,不能注册" if instr("," & lcase(session("syscfg-syskeepusername")) & ",",lcase(username)) then PopErr "该会员已存在或系统保留会员,不能注册" '需要增加字段校验信息 set rs = conn.execute("select * from winiis_userlist where username='"&username&"' ") if not rs.eof then PopErr "已经存在"&username&"用户,请选择别的用户名" end if rs.close '需要增加字段校验信息 set rs = conn.execute("select * from winiis_usergroup where groupcode='"&session("syscfg-defaultgroupcode")&"' ") if rs.eof then PopErr "系统设置的默认用户组["&session("syscfg-defaultgroupcode")&"]不存在,无法注册新会员,请与管理员联系" if rs("IsAdmin")="Y" then PopErr "系统设置的默认用户组非法,请与管理员联系" rs.close if session("syscfg-defaultlevelcode")="" then PopErr "系统未设置默认用户级别,无法注册新会员,请与管理员联系" set rs = conn.execute("select * from winiis_userlevel where levelcode='"&session("syscfg-defaultlevelcode")&"' ") if rs.eof then PopErr "系统设置的默认用户级别["&session("syscfg-defaultlevelcode")&"]不存在,无法注册新会员,请与管理员联系" rs.close '如果非代理客户,则按顺序平均分配到每一个客服 if session("webmanageuser")="" then crmuser = SafeRequest("crmuser") '如果注册页面传进来客服参数,则以传进来的优先,否则按顺序排 if crmuser="" then set rst = conn.execute("select * from winiis_config where cfgname='crmuser' ") if not rst.eof then crmuser_cur=rst("cfgvalue") crmuser_first="" set rsc = conn.execute("select * from winiis_userlist where groupcode in (select groupcode from winiis_usergroup where iscrm='Y') order by username") do while not rsc.eof if crmuser_first="" then crmuser_first=rsc("username") if crmuser_cur = rsc("username") then rsc.movenext if rsc.eof then crmuser=crmuser_first else crmuser=rsc("username") end if exit do end if rsc.movenext loop if crmuser="" then crmuser=crmuser_first end if end if regip = getregIP() set rst = conn.execute(" select count(*) from winiis_userlist where regip='"®ip&"' ") regnum=rst(0) rst.close if regnum>clng(session("syscfg-regmax")) then PopErr "对不起,您注册会员数过多,请稍后再试" '添加联系人 CID = CreateUID("CON","联系人") sql = "insert into winiis_contacts (ID,chregister,enregister,chorganize,enorganize,chcountry,encountry,chprovince,enprovince,chcity,encity,chaddress,enaddress,postcode,telephoneno,email,faxno,industry,manager,QQ,certcode,mobile) values ('"&CID&"','"&chregister&"','"&enregister&"','"&chregister&"','"&enregister&"','"&chcountry&"','"&encountry&"','"&chprovince&"','"&enprovince&"','"&chcity&"','"&encity&"','"&chaddress&"','"&enaddress&"','"&postcode&"','"&telephoneno&"','"&email&"','"&faxno&"','"&industry&"','"&manager&"','"&QQ&"','"&certcode&"','"&mobile&"' )" conn.execute(sql) '添加会员 sql = "insert into winiis_userlist (username,userpass,status,groupcode,levelcode,allprice,CID,regip,regtime,loginlog,manageuser,crmuser) values ('"&username&"','"&userpass&"','Y','"&session("syscfg-defaultgroupcode")&"','"&session("syscfg-defaultlevelcode")&"',0,'"&CID&"','"&getregIP() &"','"&now&"','','"&session("webmanageuser")&"','"&crmuser&"') " sql = sql & "delete from winiis_config where cfgname='crmuser' insert into winiis_config (cfgname,cfgvalue) values ('crmuser','"&crmuser&"') " conn.execute(sql) '添加财务总表 sql = " insert into winiis_account (username,balance,freeze,debit,regtime) values ('"&username&"',0,0,0,'"&now&"')" conn.execute(sql) ret = InitManageUserList_u (username) call WriteLog("Y","","user.reg","用户注册成功") call refreshmanagewebcfg(username) title=session("syscfg-userregtitle") body=session("syscfg-userregbody") title = emailparam(title) body=emailparam(body) body=SafeReplace(body,"[会员名]",username) body=SafeReplace(body,"[会员中文名]",chregister) body=SafeReplace(body,"[会员密码]",userpass1) ret = SendEMail(email,title,body,ErrMsg) 'if ret<>0 then ' response.write "发送邮件失败:"&ErrMsg 'else ' response.write "发送邮件成功" 'end if %> <table border=1 bordercolor=#CCCCCC bordercolordark=#ffffff cellpadding=3 cellspacing=0 width=100% align="center"> <tr> <td colspan="3" class='table_bj' height="28"> <div align="center" class="color01">会员注册结果</div> </td> </tr> <tbody> <tr> <td width="80%" height="150"> <font color=red size=4><b>注册成功!</b></font><br> <br><li>您的用户名是:<font size=3><font color=red><%=username%></FONT></font>,您的密码是:<font size=3><font color=red><b><%=userpass1%></b></font></font>,请牢记此信息。<br><br> <li>您的密码已经发送到您的邮件<%=email%>中,如果没有收到密码,请在管理中心更换一个email地址,或者联系我们。<br><br> <li>马上登录,<a href="../login.asp"><b>请点击这里</b></a>。</font> </td> </tr> </tbody> </table> <!--#include file="../inc/end_admin.asp" -->