数据库不检查用户登陆

来源:百度知道 编辑:UC知道 时间:2024/06/13 21:41:35
%
set conn=server.createobject("adodb.connection")
dim file_path
file_path=server.mappath("database\user1.mdb")
conn.connectionstring="provider=microsoft.jet.oledb.4.0;"&"data source="&file_path
conn.open
name_t=trim(request("user_pp"))
pwd_t=trim(request("pw"))
if name_t<>""and pwd_t<>"" then
spa="select * from [user_info] where name='"&name_t&"' and password='"&pwd_t&"'"
set rs=server.createobject("adodb.recordset")
rs.open spa,conn,1,1

if rs.EOF then
response.write "<script language='javascript'>" & vbcrlf
response.write "alert('用户名或密码不正确!')" & vbcrlf
response.write "history.go(-1);" & vbcrlf
response.write "</script>" & vbcrlf
response.end

if name_t<>""and pwd_t<>"" then 这句 显示只要用户名密码 不为空就打开数据库

先打客户资料数据库
做个 do while not rs.eof
IF name_t<>=RS(NAME)and pwd_t<>=RS(PASSWORD) THEN
输出内容 或其他操作
ELSE

RE.MOVENEXT
LOOP