用form里面得action属性指定到一个验证页面
验证通过跳到登陆成功页面
否则,跳到登陆失败页面

解决方案 »

  1.   

    if Request.ServerVariables("REQUEST_METHOD") = "POST" then
    dim userId
    dim password
    dim strCheck
    userId = replace(request("userId"),"'","''")
    password = replace(request("password"),"'","''")
    strCheck = "select * from 表 where UserId = '" & userId & "'"
    objRs.Open strCheck,objConn,3,3
    if not objRs.EOF then
    if objRs("password").value = trim(password) then
    session("userId") = objRs("UserId")
    session("userName") = objRs("UserName")
    session("unitId") = objRs("unitId")
    session("unitName") = objRs("ShortName")else
    objRs.Close
    Response.Write "<Script language='Javascript'>alert('登陆拒绝,密码错误!');"
    Response.write "history.back();</Script>"
    end if
    end if
    end if
      

  2.   

    正好我刚做完!
    用户名和密码如果正确,你将用户名和密码存到cookie里,然后显示的地方读cookie里的值就可以了!