<!--#include file="conn.asp"-->
<%
name=trim(request.Form("name"))
pwd=trim(request.Form("pwd"))
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from baoc where name='"&name&"' and pwd='"&pwd&"'" ,conn,1,1
if rs.eof then
response.Write"<script> alert('用户名或密码不正确');history.back(-1);</script>"
response.End()
else
end if
session("name")="name"
session("pwd")="pwd"
Dim cookies
cookies=request.cookies("name")("cookies")
if isnull(cookies) or cookies="" then cookies="0"
Select Case cookies
Case "0"
Response.Cookies("name")("cookies") = cookies
Case 1
Response.Cookies("name").Expires=Date+1
Response.Cookies("name")("cookies") = cookies
Case 2
Response.Cookies("name").Expires=Date+31
Response.Cookies("name")("cookies") = cookies
Case 3
Response.Cookies("name").Expires=Date+365
Response.Cookies("name")("cookies") = cookies
End Select
rs.close
set rs=nothing
conn.close
set conn=nothing
response.Redirect("5.asp")
%>
为什么不保存用户信息呢?