日期:2014-05-17  浏览次数:20995 次

如何修改这段DW自动生成的代码
<%
'   ***   Restrict   Access   To   Page:   Grant   or   deny   access   to   this   page
MM_authorizedUsers= " "
MM_authFailedURL= "admin_dl.asp "
MM_grantAccess=false
If   Session( "MM_Username ")   <>   " "   Then
    If   (true   Or   CStr(Session( "MM_UserAuthorization "))= " ")   Or   _
                  (InStr(1,MM_authorizedUsers,Session( "MM_UserAuthorization "))> =1)   Then
        MM_grantAccess   =   true
    End   If
End   If
If   Not   MM_grantAccess   Then
    MM_qsChar   =   "? "
    If   (InStr(1,MM_authFailedURL, "? ")   > =   1)   Then   MM_qsChar   =   "& "
    MM_referrer   =   Request.ServerVariables( "URL ")
    if   (Len(Request.QueryString())   >   0)   Then   MM_referrer   =   MM_referrer   &   "? "   &   Request.QueryString()
    MM_authFailedURL   =   MM_authFailedURL   &   MM_qsChar   &   "accessdenied= "   &   Server.URLEncode(MM_referrer)
    Response.Redirect(MM_authFailedURL)
End   If
%>

这是   服务器行为----限制对页的访问   地动生成的代码

<%
Dim   Recordset1
Dim   Recordset1_numRows

Set   Recordset1   =   Server.CreateObject( "ADODB.Recordset ")
Recordset1.ActiveConnection   =   MM_admin_sql_STRING
Recordset1.Source   =   "SELECT   *   FROM   dbo.admin_user "
Recordset1.CursorType   =   0
Recordset1.CursorLocation   =   2
Recordset1.LockType   =   1
Recordset1.Open()

Recordset1_numRows   =   0
%>
这是数据库代码

由于我数据库中的密码是通过md5( "pass ",16)这个函数加密的,而这段代码是按照原值去对比的,应该在这段代码哪里加上md5( "pass ",16)这句呢

------解决方案--------------------
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject( "ADODB.Recordset ")
Recordset1.ActiveConnection = MM_admin_sql_STRING
Recordset1.Source = "SELECT * FROM dbo.admin_user where 字段名= ' " & md5( "pass ",16) & " ' "
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
------解决方案--------------------
根据密码找?什么逻辑,密码相同的数据多得是
------解决方案--------------------
Recordset1.Source = "SELECT * FROM dbo.admin_user where 字段名= ' " & md5( "pass ",16) & " ' and 用户名= ' "& 用户名 & " ' "

这样行了吧?给个例子给你看看而已嘛,自己变通一下就可以了呀~