<%
set conn= Server.CreateObject("adodb.connection")
cs="provider=microsoft.jet.oledb.4.0;data source="
conn.connectionstring=cs & server.MapPath("info-share.mdb")
conn.open
%>
<%
set rs= Server.CreateObject("adodb.recordset")
dim strname,pword
strname=request.Form("user1")
pword=request.Form("password1")
sql="select * from [user]"
sql=sql & "where username='"&trim(strname)&"'"
rs.open sql,conn,1,3
if strname="" then
response.Write("账号不能为空!<p></p>")
%>
<a href="index.html">返回!</a>
<%
response.End
end if
if pword="" then
response.Write("密码不能为空!<p></p>")
%>
<a href="index.html">返回!</a>
<%
response.End
end if
if rs.recordcount=1 then
if
rs("userpassword")=pword then
session("name")=strname
response.Redirect("user-view.html")
else
%>
<a href="index.html">密码错误,请重新输入!</a>
<%
end if
else
%>
<a href="index.html"> 账号错误,请重新输入!</a>
<%
response.End
end if
rs.close
set rs=nothing
%>
</body>
以上就是源码