- <%
- name=trim(request.form("myname"))'用户名
- word=trim(request.form("psw")) ’密码
- if name="" or word="" then
- response.write"<script>alert('用户名或密码不能为空');history.back();</script>"
- response.end
- end if
- set rs=server.createobject("adodb.recordset")
- rs.open "select * from s1 where name='"& name &"' and word='"& word &"' ","driver={microsoft access driver (*.mdb)};dbq=" & Server.MapPath("s1.mdb")
- if rs.eof then
- response.write "<script>alert('登录失败');history.back();</script>"
- response.end
- else
- session("myname")= name
- session("pur")=rs("nameid")
- response.redirect "htgladmin.asp"
- end if
- %>
复制代码 S1表单名 S1.mdb数据库名 可以自己定义 |