主頁(yè) > 知識(shí)庫(kù) > Discuz!NT 論壇整合ASP程序論壇教程

Discuz!NT 論壇整合ASP程序論壇教程

熱門(mén)標(biāo)簽:外呼系統(tǒng)還用卡么 地圖標(biāo)注服務(wù)哪家好 武漢營(yíng)銷電話機(jī)器人軟件 徐州人工智能電銷機(jī)器人好用嗎 長(zhǎng)沙防封電銷卡品牌 地圖標(biāo)注宅基地 騰訊地圖標(biāo)注商戶關(guān)閉 智能電銷機(jī)器人適用于哪些行業(yè) 西寧公司外呼系統(tǒng)平臺(tái)
復(fù)制代碼 代碼如下:

登陸時(shí)記錄cookies頁(yè)面代碼
!--#include file="md5.asp"--> //32位md5加密文件,一定得調(diào)用,該文件到處有,我就不提供了
%
dim Username,Password,Question,Answer,Expires,Verify
Username=replace(trim(Request.form("Username")),"'","''") //用戶名
Password=replace(trim(Request.form("Password")),"'","''") //用戶密碼
Question=replace(trim(Request.form("Question")),"'","''") //密碼問(wèn)題
Answer=replace(trim(Request.form("Answer")),"'","''") //密碼答案
Expires=replace(trim(Request.form("Expires")),"'","''") //cookies記錄時(shí)長(zhǎng)
Verify=replace(trim(Request.form("Verify")),"'","''") //驗(yàn)證碼
//此處加上提交的驗(yàn)證,如xxx不能為空等或字段長(zhǎng)度等
sql="select * from [dnt_users] where username='"Username"'" //為了方便,此處我就不加過(guò)濾函數(shù)了,如你使用時(shí)一定加上,否則被注入
set rs=conn.execute(sql)
if rs.eof then
Response.Write ("script>alert('提示!\n\n用戶帳號(hào)錯(cuò)誤!');history.back();/script>")
Response.end
else
if rs("password")>md5(Password) then
Response.Write ("script>alert('提示!\n\n用戶密碼錯(cuò)誤!');history.back();/script>")
Response.end
else
if rs("secques")>Answer then
Response.Write ("script>alert('提示!\n\n安全答案錯(cuò)誤!');history.back();/script>")
Response.end
else
Dim DES,DESCode
Set DES=Server.CreateObject("DiscuzNT.DES")
DESCode=DES.Encode(""rs("password")"","Z143D2VBML") //Z143D2VBML為你的DES加密密鑰,請(qǐng)用記事本打開(kāi)CONFIG目錄里的general.config文件,找到Passwordkey>Z846D4VVZL/Passwordkey>這行,Passwordkey>與/Passwordkey>中間的英文就是你的密鑰,把密鑰修改成你的文件的
Set DES=Nothing
Response.Cookies("dnt")("userid") = rs("uid")
Response.Cookies("dnt")("password") = DESCode
Response.Cookies("dnt")("tpp") = rs("tpp")
Response.Cookies("dnt")("ppp") = rs("ppp")
Response.Cookies("dnt")("pmsound") = rs("pmsound")
Response.Cookies("dnt")("invisible") = rs("invisible")
Response.Cookies("dnt")("referer") = "index.aspx"
Response.Cookies("dnt")("sigstatus") = rs("sigstatus")
Response.Cookies("dnt")("expires") = Expires
if Expires>0 then
Response.Cookies("dnt").Expires = DateAdd("N", Expires, Now())
end if
Response.Cookies("dnt").Domain = ".xxx.com" //修改為你的域名,注意前面帶.(點(diǎn))
Response.Cookies("dnt").Secure = False
end if
end if
end if
rs.close
set rs=nothing
//此處加登陸后轉(zhuǎn)向或向其他操作,具體你自己看著辦
%>



===========================================================================================
注冊(cè)頁(yè)面代碼(注冊(cè)完后同時(shí)登陸狀態(tài))

!--#include file="md5.asp"--> //32為md5加密文件,一定得調(diào)用,該文件到處有,我就不提供了
%
dim Username,Password,CheckPassword,Email,Question,Answer,Verify
Username=replace(trim(Request.form("Username")),"'","''") //用戶名
Password=replace(trim(Request.form("Password")),"'","''") //用戶密碼
CheckPassword=replace(trim(Request.form("CheckPassword")),"'","''") //密碼驗(yàn)證
Question=replace(trim(Request.form("Question")),"'","''") //密碼問(wèn)題
Answer=replace(trim(Request.form("Answer")),"'","''") //密碼答案
Expires=replace(trim(Request.form("Expires")),"'","''") //cookies記錄時(shí)長(zhǎng)
Verify=replace(trim(Request.form("Verify")),"'","''") //驗(yàn)證碼
//此處加上提交的驗(yàn)證,如xxx不能為空等或字段長(zhǎng)度等
sql="select * from [dnt_users] where username='"Username"'" //為了方便,此處我就不加過(guò)濾函數(shù)了,如你使用時(shí)一定加上,否則被注入
set rs=conn.execute(sql)
if not rs.eof then
Response.Write ("script>alert('提示!\n\n用戶帳號(hào)已被注冊(cè)使用!');history.back();/script>")
Response.end
end if
rs.close
set rs=nothing
sql="select * from [dnt_users] where Email='"Email"'" //為了方便,此處我就不加過(guò)濾函數(shù)了,如你使用時(shí)一定加上,否則被注入
set rs=conn.execute(sql)
if not rs.eof then
Response.Write ("script>alert('提示!\n\n電子郵箱已被注冊(cè)使用!');history.back();/script>")
Response.end
end if
rs.close
set rs=nothing
ip = request.servervariables("http_x_forwarded_for")
if ip = "" then ip = request.servervariables("remote_addr")
sql="insert into [dnt_users] (username,nickname,password,secques,gender,adminid,groupid,groupexpiry,extgroupids,regip,joindate,lastip,lastvisit,lastactivity,lastpost,lastpostid,lastposttitle,posts,digestposts,oltime,pageviews,credits,extcredits1,extcredits2,extcredits3,extcredits4,extcredits5,extcredits6,extcredits7,extcredits8,avatarshowid,email,bday,sigstatus,tpp,ppp,templateid,pmsound,showemail,newsletter,invisible,newpm,newpmcount,accessmasks,onlinestate) values ('"Username"',' ','"MD5(Password)"','"Answer"',0,0,10,0,' ','"ip"','"now()"','"ip"','"now()"','"now()"','"now()"',0,' ',0,0,0,0,0,'0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00',0,'"Email"',' ',1,0,0,0,1,1,1,0,1,1,0,1)"
set rs=conn.execute(sql)
sql="select uid from [dnt_users] where username='"Username"'" //為了方便,此處我就不加過(guò)濾函數(shù)了,如你使用時(shí)一定加上,否則被注入
set rs=conn.execute(sql)
Uid=rs(0)
sql="insert into [dnt_userfields] (uid,avatar,avatarwidth,avatarheight,authtime,authflag) values ('"Uid"','avatars\common\0.gif',0,0,'"now()"',0)"
set rs=conn.execute(sql)
sql="update [dnt_statistics] set totalusers=totalusers+1,lastusername='"Username"',lastuserid='"Uid"'"
set rs=conn.execute(sql)
sql="select * from [dnt_users] where username='"Username"'" //為了方便,此處我就不加過(guò)濾函數(shù)了,如你使用時(shí)一定加上,否則被注入
set rs=conn.execute(sql)
if rs.eof then
Response.Write ("script>alert('提示!\n\n用戶帳號(hào)錯(cuò)誤!');history.back();/script>")
Response.end
else
if rs("password")>md5(Password) then
Response.Write ("script>alert('提示!\n\n用戶密碼錯(cuò)誤!');history.back();/script>")
Response.end
else
Dim DES,DESCode
Set DES=Server.CreateObject("DiscuzNT.DES")
DESCode=DES.Encode(""rs("password")"","Z143D2VBML") //Z143D2VBML為你的DES加密密鑰,請(qǐng)用記事本打開(kāi)CONFIG目錄里的general.config文件,找到Passwordkey>Z846D4VVZL/Passwordkey>這行,Passwordkey>與/Passwordkey>中間的英文就是你的密鑰,把密鑰修改成你的文件的
Set DES=Nothing
Response.Cookies("dnt")("userid") = rs("uid")
Response.Cookies("dnt")("password") = DESCode
Response.Cookies("dnt")("tpp") = rs("tpp")
Response.Cookies("dnt")("ppp") = rs("ppp")
Response.Cookies("dnt")("pmsound") = rs("pmsound")
Response.Cookies("dnt")("invisible") = rs("invisible")
Response.Cookies("dnt")("referer") = "index.aspx"
Response.Cookies("dnt")("sigstatus") = rs("sigstatus")
Response.Cookies("dnt")("expires") = 0
Response.Cookies("dnt").Domain = ".xxx.com" //修改為你的域名,注意前面帶.(點(diǎn))
Response.Cookies("dnt").Secure = False
end if
end if
rs.close
set rs=nothing
//此處加注冊(cè)后轉(zhuǎn)向或向另外一個(gè)用戶表添加同步用戶數(shù)據(jù),具體你自己看著辦
%>



===========================================================================================
編輯頁(yè)面代碼(編輯密碼后無(wú)需重新登陸)

!--#include file="md5.asp"--> //32為md5加密文件,一定得調(diào)用,該文件到處有,我就不提供了
%
dim Username,Password,CheckPassword,Email,Question,Answer,Verify
Username=replace(trim(Request.form("Username")),"'","''") //用戶名
Password=replace(trim(Request.form("Password")),"'","''") //用戶密碼
CheckPassword=replace(trim(Request.form("CheckPassword")),"'","''") //密碼驗(yàn)證
Question=replace(trim(Request.form("Question")),"'","''") //密碼問(wèn)題
Answer=replace(trim(Request.form("Answer")),"'","''") //密碼答案
Expires=replace(trim(Request.form("Expires")),"'","''") //cookies記錄時(shí)長(zhǎng)
Verify=replace(trim(Request.form("Verify")),"'","''") //驗(yàn)證碼
//此處加上提交的驗(yàn)證,如xxx不能為空等或字段長(zhǎng)度等
if Password>"" then
if Password>CheckPassword then
Response.Write ("script>alert('提示!\n\n驗(yàn)證密碼與用戶密碼不相同!');history.back();/script>")
Response.end
end if
Password=MD5(Password)
else
Password=U_Password //U_Password為你的32位MD5加密密碼,在驗(yàn)證時(shí)讀取出來(lái)用來(lái)這里驗(yàn)證
end if
if AnswerTrue="true" then
if Question>0 then
Answer=mid(MD5(Answer+MD5(Question)),16,8)
else
Answer=" "
end if
else
Answer=U_Secques //U_Secques為你的密碼答案,在驗(yàn)證時(shí)讀取出來(lái)用來(lái)這里驗(yàn)證
end if
ip = request.servervariables("http_x_forwarded_for")
if ip = "" then ip = request.servervariables("remote_addr")
sql="select * from [dnt_users] where username='"Username"'" //為了方便,此處我就不加過(guò)濾函數(shù)了,如你使用時(shí)一定加上,否則被注入
set rs=Conn.execute(Sql)
If Rs.eof then
Response.Write ("script>alert('提示!\n\n用戶帳號(hào)錯(cuò)誤!');history.back();/script>")
Response.end
else
sql="select * from [dnt_users] where email='"Email"' and username>'"Username"'" //為了方便,此處我就不加過(guò)濾函數(shù)了,如你使用時(shí)一定加上,否則被注入
set rs=conn.execute(sql)
if not rs.eof then
response.write ("script>alert('友情提示!\n\n郵箱已被使用!');history.back();/script>")
response.end
else
sql="update [dnt_users] set password='"Password"',secques='"Answer"',email='"Email"' where username='"Username"'" //為了方便,此處我就不加過(guò)濾函數(shù)了,如你使用時(shí)一定加上,否則被注入
set rs=conn.execute(sql)
Set DES=Server.CreateObject("DiscuzNT.DES")
DESCode=DES.Encode(""Password"","Z143D2VBML") //Z143D2VBML為你的DES加密密鑰,請(qǐng)用記事本打開(kāi)CONFIG目錄里的general.config文件,找到Passwordkey>Z846D4VVZL/Passwordkey>這行,Passwordkey>與/Passwordkey>中間的英文就是你的密鑰,把密鑰修改成你的文件的
Set DES=Nothing
Response.Cookies("dnt")("userid") = rs("uid")
Response.Cookies("dnt")("password") = DESCode
Response.Cookies("dnt")("tpp") = rs("tpp")
Response.Cookies("dnt")("ppp") = rs("ppp")
Response.Cookies("dnt")("pmsound") = rs("pmsound")
Response.Cookies("dnt")("invisible") = rs("invisible")
Response.Cookies("dnt")("referer") = "index.aspx"
Response.Cookies("dnt")("sigstatus") = rs("sigstatus")
Response.Cookies("dnt")("expires") = 0
Response.Cookies("dnt").Domain = ".xxxx.com" //修改為你的域名,注意前面帶.(點(diǎn))
Response.Cookies("dnt").Secure = False
end if
end if
rs.close
set rs=nothing
//此處加編輯后轉(zhuǎn)向或向另外一個(gè)用戶表添加同步用戶數(shù)據(jù),具體你自己看著辦
%>


=============================================================================================
退出驗(yàn)證cookies頁(yè)面代碼

%
Response.Cookies("dnt")("userid") = ""
Response.Cookies("dnt")("password") = ""
Response.Cookies("dnt")("tpp") = ""
Response.Cookies("dnt")("ppp") = ""
Response.Cookies("dnt")("pmsound") = ""
Response.Cookies("dnt")("invisible") = ""
Response.Cookies("dnt")("referer") = ""
Response.Cookies("dnt")("sigstatus") = ""
Response.Cookies("dnt")("expires") = ""
Response.Cookies("dnt").Expires = ""
Response.Cookies("dnt").Domain = ".xxx.com"
Response.Cookies("dnt").Secure = False
Response.Write ("script>alert('提示!\n\n用戶注銷登陸完畢!');self.opener.location.reload();window.close();/script>")
Response.end
%>


==============================================================================================
驗(yàn)證cookies頁(yè)面代碼,這是我為了簡(jiǎn)單隨手寫(xiě)的一段驗(yàn)證代碼,基本都是大同小異,具體你根據(jù)你的asp程序驗(yàn)證文件來(lái)修改
%>
Dim DES,DESCode
Set DES=Server.CreateObject("DiscuzNT.DES")
DESCode=DES.Decode(""request.cookies("dnt")("password")"","Z143D2VBML") //Z143D2VBML為你的DES加密密鑰,請(qǐng)用記事本打開(kāi)CONFIG目錄里的general.config文件,找到Passwordkey>Z846D4VVZL/Passwordkey>這行,Passwordkey>與/Passwordkey>中間的英文就是你的密鑰,把密鑰修改成你的文件的
Set DES=Nothing
//下面是讀取數(shù)據(jù)庫(kù)來(lái)驗(yàn)證你的cookies是否正確
dim U_UId,U_UserName,U_Password,U_Secques,U_Email
Sql="select uid,username,password,secques,email from [dnt_users] where uid='"request.cookies("dnt")("userid")"' and password='"DESCode"'" //為了方便,cookies用戶和密碼我就不加過(guò)濾函數(shù)了,如你使用時(shí)一定加上,否則被注入,就過(guò)濾些單引號(hào)及一些比較敏感的就可以了
Set Rs=Conn.execute(Sql)
if not rs.eof then
founduser = true
U_UId = Rs(0)
U_UserName = Rs(1)
U_Password = Rs(2)
U_Secques = Rs(3)
U_Email = Rs(4)
else
founduser = false
end if
rs.close
set rs=nothing
%>

標(biāo)簽:通遼 巴彥淖爾 荊門(mén) 鷹潭 運(yùn)城 通化 普洱 雅安

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Discuz!NT 論壇整合ASP程序論壇教程》,本文關(guān)鍵詞  Discuz,論壇,整合,ASP,程序,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Discuz!NT 論壇整合ASP程序論壇教程》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于Discuz!NT 論壇整合ASP程序論壇教程的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章