用户登录部分功能调用由位于发布目录c:\website下的login.asp文件实现,数据库连接由conn.Asp文件实现。其中,数据库文件名为account.Mdb,用户表为actuser,用户名字段和用户密码字段分别为act_username和act_password。Login.asp代码如下所示,请将空缺的部分补充完整,并填写在答题纸的相应位置。
<!--#include file=”conn.asp”—>
<%
sql=”select * from actuser where act username=’”&username&”’”
rs.open sql,conn, 1,1
if (1) then
response .write “<script>alert(‘登录失败’) ;history.back() ;</script>”
response, end
else
if rs (“act_password”) <>password then
response .write “<script>alert (‘登录失败’); history, back(); </script>”
(2)
end if
ses sion ( “admin” ) =username
response, write”<script>alert (‘登陆成功’); location.href=’index, asp’
</script>”
(3)
%>
文中(1)应为()。
参考答案:rs.eof