‘构造一个sql语句 sqltemp1="select * from UserInfo where userid='"&strname&"' and password='"&strpassword&"'" ‘查询数据库 rstemp.open sqltemp1,conn, 1, 1 if not(rstemp.bof and rstemp.eof) then Response.Write (“login=true”) end if
5、建立一个guest.asp文件,文件内容为 <%
username = Request(“userid”)
password = Request(“pwd”)
set conn=Server.CreateObject("ADODB.Connection")
conn.open application("Driver={SQL Server};SERVER=192.168.1.32;DATABASE=test;UID=zengyu;PASSWORD=123")
set rstemp=Server.CreateObject("ADODB.Recordset")
sqltemp1="select * from UserInfo where userid='"&username&"' and password='"&strpassword&"'"
rstemp.open sqltemp1,conn, 1, 1
if not(rstemp.bof and rstemp.eof) then
Response.Write (“login=true”)