4. log on
As mentioned above, login is a query. It mainly depends on the login processing page.Checklogin. asp
<HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> test logon </title>
</Head>
<Body>
<%
Username = request. Form ("username ")
Password = request. Form ("userpwd ")
'Connect to the database below and create a connection object instance DB
Dim DB
Set DB = server. Createobject ("ADODB. Connection ")
DB. Open "DBQ =" & server. mappath ("data. mdb") & "; driver = {Microsoft Access Driver (*. mdb )}"
// Query SQL statements
Strsql = "select * from user where username = '" & username & "' and userpwd = '" & password &"'"
Set rsmongodb.exe cute (strsql)
If Rs. EOF then
Response. Write "incorrect user name or password"
Else' successful
Session ("un") = username // save to the session, and the page will judge the permission call
Session ("up") = Password
Response. Redirect ("index. asp") // redirect to the Home Page
End if
Set rs = nothing
%>
</Body>
</Html>