discuz! NT Forum Integration ASP Program Forum _ Application Tips

Source: Internet
Author: User
Tags md5
Copy Code code as follows:

<% @LANGUAGE = "VBSCRIPT" codepage= "65001"%>
<!--#include virtual= "/inc/md5.asp"-->
<!--#include virtual= "/inc/conn.asp"-->

<%
' MD5 1234656789 323b453885f5181f
' Discuz 25f9e794323b453885f5181f1b624d0b
' Response.Write (Md5 ("123456789"))
' Response.Write ("Cookie:" &request.cookies ("dnt") ("userid")
Dim username:username = Request.Form ("UserName")
Dim Password:password = Request.Form ("PassWord")

Set objRS = Conn.execute ("select * from member_user where UserName = '" &username "")
If Not objrs.eof Then
Response.Write (objRS ("UserPassword"))

Set conn2 = server. CreateObject ("ADODB.") Connection ")
Conn2.open "Provider = SQLOLEDB; User ID = sa; Password = 123456; Initial Catalog = dnt; Data Source = mww\sqlexpress; "


Set objRs2 = Conn2.execute ("select * from [dnt_users] where username= '" &username "")
If not objrs2.eof Then
Response.Write ("<br/>" &objrs2 ("UID") "<br/>")
Response.Write (OBJRS2 ("password") "<br/>")
Response.Write (ObjRs2 ("TPP") "<br/>")
Response.Write (OBJRS2 ("PPP") "<br/>")
Response.Write (ObjRs2 ("Pmsound") "<br/>")
Response.Write (ObjRs2 ("invisible") "<br/>")
Response.Write (ObjRs2 ("Sigstatus") "<br/>")

' Userid=2&password=0p273vmb%2bonhszsw%2fttgpb%2fz4pb7cbwl&avatar=avatars%5ccommon%5c0.gif&tpp=0 &ppp=0&pmsound=1&invisible=0&referer=index.aspx&sigstatus=1&expires=-1
' Generate cookies
Response.Cookies ("dnt") ("userid") = ObjRs2 ("UID")
Response.Cookies ("dnt") ("password") = OBJRS2 ("password")
Response.Cookies ("dnt") ("TPP") = ObjRs2 ("TPP")
Response.Cookies ("dnt") ("PPP") = OBJRS2 ("PPP")
Response.Cookies ("dnt") ("pmsound") = ObjRs2 ("Pmsound")
Response.Cookies ("dnt") ("invisible") = ObjRs2 ("invisible")
Response.Cookies ("dnt") ("referer") = "index.aspx"
Response.Cookies ("dnt") ("sigstatus") = ObjRs2 ("Sigstatus")
' Response.Cookies ("dnt") ("expires") = Expires
' If Expires<>0 then
' Response.Cookies ("dnt"). Expires = DateAdd ("N", Expires, Now ())
' End If
Response.Cookies ("dnt"). Domain = ". ejia.com" ' Modified for your domain, pay attention to the front band. Point

Response.Cookies ("dnt"). Secure = False



End If
Objrs2.close
Set objRs2 = Nothing
Conn2. Close
Set conn2 = Nothing

End If
Objrs.close
Set objRS = Nothing
Conn.close
Set conn = Nothing
%>
<form action= "cookie.asp" method= "POST" >
User name: <input type= "text" name= "UserName"/><br/>
Password: <input type= "text" name= "PassWord"/>
<input type= "Submit" value= "Landing"/>
</form>

1. Change the MD5 function code in the common project to:
return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile (str, "MD5"). ToLower (). Substring (8, 16), the main station and the forum to achieve unified encryption mode. Because the Discuz default is 32-bit encryption, but the consolidated ASP is 16-bit encryption, if it is 32-bit, you do not need to modify.

2, the common project in the encode and decode into direct return.

The Common Discuz.Common.rar that has been handled well
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.