禁止用户注册已有用户注册了的即时通讯号码

By enger at 2007-03-05 • 0人收藏 • 1155人看过

由于本人前两天提供的代码不行,经过不断的尝试终于成功了,希望大家可以用上!
另,本修改应和wwwbigbug的“用QQ登陆论坛”结合使用,下面的修改为“所用的即时通讯登陆”,与wwwbigbug的略有不同

login.asp文件
找到
if username=empty then error("<li>用户名没有输入!")
下面加入
if IsNumeric(username) then
sql="select username,userpassword from [user] where (UserIM like '"&username&"%' or UserIM like '%"&username&"%' or UserIM like '%"&username&"') and userpassword='"&userpassword&"'"
set rs=Conn.Execute(sql)
if rs.eof then
set rs=nothing
else
username=rs("username")
set rs=nothing
end if
end if

CreateUser.asp文件
找到
password=Trim(Request.Form("password"))
Userpass2=Trim(Request.Form("Userpass2"))
UserMail=HTMLEncode(Request.Form("UserMail"))
Userhome=HTMLEncode(Request.Form("Userhome"))
PasswordQuestion=HTMLEncode(Request.Form("PasswordQuestion"))
PasswordAnswer=HTMLEncode(Request.Form("PasswordAnswer"))
Userface=HTMLEncode(Request.Form("Userface"))
UserSex=HTMLEncode(Request.Form("UserSex"))
birthday=HTMLEncode(Request.Form("birthday"))
换成
password=Trim(Request.Form("password"))
Userpass2=Trim(Request.Form("Userpass2"))
UserMail=HTMLEncode(Request.Form("UserMail"))
Userhome=HTMLEncode(Request.Form("Userhome"))
PasswordQuestion=HTMLEncode(Request.Form("PasswordQuestion"))
PasswordAnswer=HTMLEncode(Request.Form("PasswordAnswer"))
Userface=HTMLEncode(Request.Form("Userface"))
UserSex=HTMLEncode(Request.Form("UserSex"))
birthday=HTMLEncode(Request.Form("birthday"))
qq=HTMLEncode(Request.Form("qq"))
icq=HTMLEncode(Request.Form("icq"))
uc=HTMLEncode(Request.Form("uc"))
aim=HTMLEncode(Request.Form("aim"))
msn=HTMLEncode(Request.Form("msn"))
yahoo=HTMLEncode(Request.Form("yahoo"))

找到
Rs("UserIM")=""&HTMLEncode(Request("qq"))&"\"&HTMLEncode(Request("icq"))&"\"&HTMLEncode(Request("uc"))&"\"&HTMLEncode(Request("aim"))&"\"&HTMLEncode(Request("msn"))&"\"&HTMLEncode(Request("Yahoo"))&""
换成
rs("UserIM")=""&qq&"\"&icq&"\"&uc&"\"&aim&"\"&msn&"\"&Yahoo&""

找到
If not conn.Execute("Select id From [user] where username='"&username&"'" ).eof Then error2("此用户名已经被别人注册了")
下面加入
'禁止用户注册已有用户注册了的即时通讯号码开始----------Enger
if qq<>"" or uc<>"" or icq<>"" or msn<>"" or aim<>"" or Yahoo<>"" then
If not conn.Execute("select id from [user] where UserIM like '"&qq&"%' and UserIM like '%"&icq&"%' and UserIM like '%"&uc&"%' and UserIM like '%"&aim&"%' and UserIM like '%"&msn&"%' and UserIM like '%"&Yahoo&"'").eof Then error2("此即时通讯号码已经被别人注册了")
end if
'禁止用户注册已有用户注册了的即时通讯号码结束----------Enger

登录后方可回帖

登 录
信息栏

Carbon Forum是一个基于话题的高性能轻型PHP论坛

下载地址:Carbon Forum v5.9.0
QQ群:12607708(QQ我不常上)

donate

手机支付宝扫描上方二维码可向本项目捐款

粤公网安备 44030602003677号
粤ICP备17135490号

Loading...