人呢 算了 我把全部代码贴上来
达到相似的功能就ok了
<!-- #include file="conn.asp" -->
<%
vUserName=trim(Request.Form("name"))
vPwd=trim(Request.Form("Pwd"))
'============从表content中读取用户数据==============
'定义Recordset对象
Set rs=Server.CreateObject("ADODB.Recordset")
'设置Connection对象的ConnectionString
'设置rs的ActiveConnection属性,绑定到连接
Set rs.ActiveConnection = Conn
'设置游标类型
rs.CursorType = 3
'打开记录集
rs.Open "SELECT * FROM content WHERE UserName='" & vUserName & "'"
'=============身份验证===========================
If rs.EOF Then
response.Write("<script language='javascript'>alert('新访友请注册!');location.href='IsRegister.asp';</script>")
Else
If vPwd <> rs("Pwd") Then
response.Write("<script language='javascript'>alert('密码不正确!');location.href='IsRegister.asp';</script>")
Else
response.Cookies("Username") =vUserName
response.Cookies("Pwd") =vPwd
response.Write "<script language='javascript'>alert('欢迎再次留言,谢谢!'); location.href='IsRegister.asp';</script>"
set rs = nothing
conn.close
set conn = nothing
end if
end if
%>