问题描述
我的用户注册区分大小写的,怎么样才能让他不区分大小写呢?不要js语言,要asp语言...<!--#includefile="../../inc/conn.asp"--><%login_name=trim(request.Form("username"))login_pw=trim(request.Form("passWord"))login_repw=trim(request.Form("passWord_Config"))login_truename=trim(request.Form("contacter"))login_sex=trim(request.Form("male"))login_email=trim(request.Form("email"))login_tel1=trim(request.Form("telePhone1"))login_tel2=trim(request.Form("telePhone2"))login_tel3=trim(request.Form("telePhone3"))login_tel4=trim(request.Form("telePhone4"))login_fax1=trim(request.Form("fax1"))login_fax2=trim(request.Form("fax2"))login_fax3=trim(request.Form("fax3"))login_fax4=trim(request.Form("fax4"))login_mb=trim(request.Form("MP"))login_Co=trim(request.Form("genre"))login_Coname=trim(request.Form("name"))login_Co_add_1=trim(request.Form("selectp"))login_Co_add_2=trim(request.Form("selectc"))login_Co_address=trim(request.Form("address"))login_hangye=trim(request.Form("area"))regEx.IgnoreCase=Truesetrs=server.CreateObject("adodb.recordset")sql="select*fromuserlist"rs.opensql,conn,1,3ifrs("uname")=login_namethenresponse.Write"<scriptlanguage='javascript'>window.confirm('你输入的用户名已经存在')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelseiflen(trim(request.Form("username")))>15orlen(trim(request.Form("username")))<4thenresponse.Write"<scriptlanguage='javascript'>window.confirm('用户名必须在4-15个字符数内')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelseiflogin_name=""thenresponse.Write"<scriptlanguage='javascript'>window.confirm('用户名不能为空')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelseiflogin_pw=""thenresponse.Write"<scriptlanguage='javascript'>window.confirm('密码不能为空')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelseiflogin_pw<>login_repwthenresponse.Write"<scriptlanguage='javascript'>window.confirm('密码与密码验证不一致')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelseiflogin_truename=""thenresponse.Write"<scriptlanguage='javascript'>window.confirm('真实姓名不能为空')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelseiflogin_email=""thenresponse.Write"<scriptlanguage='javascript'>window.confirm('Email不能为空')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelseiflogin_tel3=""thenresponse.Write"<scriptlanguage='javascript'>window.confirm('电话号码不能为空')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelseiflogin_Coname=""thenresponse.Write"<scriptlanguage='javascript'>window.confirm('公司名称不能为空')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelseiflogin_Co_add_1=""thenresponse.Write"<scriptlanguage='javascript'>window.confirm('公司省份不能为空')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelseiflogin_Co_add_2=""thenresponse.Write"<scriptlanguage='javascript'>window.confirm('公司县/市不能为空')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelseiflogin_Co_address=""thenresponse.Write"<scriptlanguage='javascript'>window.confirm('公司经营地址无法为空')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelseiflogin_hangye=""thenresponse.Write"<scriptlanguage='javascript'>window.confirm('公司经营行业不能为空')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelseiftrim(request.Form("ValidKey"))<>trim(Session("GetCode"))thenresponse.Write"<scriptlanguage='javascript'>window.confirm('验证码错误')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelseaddsql="insertintouserlist(uname,upass,reupass,truename,sex,email,tel,tel01,tel02,tel03,fax,fax01,fax02,fax03,mbail,Cotype,Coname,Coadd01,Coadd02,buyadd,hangye,times)values('"&login_name&"','"&login_pw&"','"&login_repw&"','"&login_truename&"','"&login_sex&"','"&login_email&"','"&login_tel1&"','"&login_tel2&"','"&login_tel3&"','"&login_tel4&"','"&login_fax1&"','"&login_fax2&"','"&login_fax3&"','"&login_fax4&"','"&login_mb&"','"&login_Co&"','"&login_Coname&"','"&login_Co_add_1&"','"&login_Co_add_2&"','"&login_Co_address&"','"&login_hangye&"','"&timee&"')"setrs=conn.execute(addsql)Conn.CloseSetConn=Nothingresponse.Write"<scriptlanguage='javascript'>window.confirm('注册成功,非常感谢!')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../../index.asp';</script>"endifendifendifendifendifendifendifendifendifendifendifendifendifendif%>还有就是,我自动获得当前时间,老是出错...说datetime字符转换错误...顺便帮帮我...用户注册时候用户名限制中文...,还有email的格式..谢谢了..
解决方案
解决方案二:
大小写无区别,你可以登入时全部转换成大或小写就可以了upper(UserName)
解决方案三:
strTime=System.DateTime.Now.ToShortDateString()
解决方案四:
在数据库里设置
解决方案五:
....太棒了...liusaup简直就是再世华佗呀!!!
解决方案六:
endifendifendifendifendifendifendifendifendifendifendifendifendifendif我深深地被震撼了。
解决方案七:
哈哈高手还是有地
解决方案八:
同5楼。。。。
解决方案九:
......5楼的老大....偶不太会写selectcase....难道这样写错了吗?.....但是好象可以的说....endifendifendifendifendifendifendifendifendifendifendifendifendifendif
解决方案十:
我还是楼主....问下...我想设置用户名字不能用中文字符...该怎么办?...还有email的..比如:iflogin_name=中文thenresponse.Write"<scriptlanguage='javascript'>window.confirm('你输入的用户名不能有中文')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../office_user.asp';</script>"response.Endelse还有屏蔽emial格式的....麻烦说下..谢谢..
解决方案十一:
引用8楼fanbomb8897410的回复:
......5楼的老大....偶不太会写selectcase....难道这样写错了吗?.....但是好象可以的说....endifendifendifendifendifendifendifendifendifendifendifendifendifendif
你觉得这可以用selectcase?是你写不出来?我也写不出来。楼主脑子只有“如果....否则....”?如果...,如果...,如果...,如果...,如果...,如果...,就如果了。
解决方案十二:
火死我了.....各位高手大人...十万火急啊..我注册那里成功了,用户名不区分大小写了,但是我设置了密码区分大小写,可是,我前台登陆的时候,密码居然无视大小写...该怎么办?我把代码贴出来..<!--#includefile="../../inc/conn.asp"--><%ifrequest.Form("sub")="sub"thenlogin_name=trim(request.Form("username"))login_pw=trim(request.Form("userpass"))iflogin_name=""orlogin_pw=""thenresponse.Redirect("error.asp?error=004")elsesetrs=server.CreateObject("adodb.recordset")sql="select*fromuserlistwhereuname='"&login_name&"'andupass='"&login_pw&"'"rs.opensql,conn,1,1ifnotrs.eofthensession("login_name")=rs("uname")session("login_id")=rs("id")response.Redirect("../../index.asp")elseresponse.Redirect("error.asp?error=003")endifendifendif%>
解决方案十三:
sql="select*fromuserlistwhereuname='"&login_name&"'andupass='"&login_pw&"'"这就是注入攻击的典型目标selectupassfromuserlistwhereuname='xxx'if不存在then咔嚓endifif输入密码<>rs(0)then也咔嚓endif
解决方案十四:
.....谢谢了...什么破书....sql="select*fromuserlistwhereuname='"&login_name&"'andupass='"&login_pw&"'"书上说这样写.....
解决方案十五:
<!--#includefile="../../inc/conn.asp"--><%ifrequest.Form("sub")="sub"thenlogin_name=trim(request.Form("username"))login_pw=trim(request.Form("userpass"))iflogin_name=""orlogin_pw=""thenresponse.Redirect("error.asp?error=004")elsesetrs=server.CreateObject("adodb.recordset")sql="selectupassfromuserlistwhereuname='"&login_name&"'"rs.opensql,conn,1,1ifrs("uname")<>login_namethenresponse.Write"<scriptlanguage='javascript'>window.confirm('用户名错误')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../../index.asp';</script>"response.Endendififrs("upass")<>login_pwthenresponse.Write"<scriptlanguage='javascript'>window.confirm('密码错误')</script>"response.Write"<scriptlanguage='JavaScript'>self.location='../../index.asp';</script>"response.Endendififnotrs.eofthensession("login_name")=rs("uname")session("login_id")=rs("id")response.Redirect("../../index.asp")elseresponse.Redirect("error.asp?error=003")endifendifendif%>登陆页面我现在写成这样了....行了吗?...