关于ASP中的cookies用法请ASP高手进
我刚刚学习ASP中的response.cookies 但我自己试着写段代码就不能运行了。。不知道为什么<!-- #include file="conn.asp"--><%if request.cookies("userlogin")=ture thenresponse.write"欢迎您"elseresponse.write"您尚未登陆"end ifsub login()If Request.Form("username")<>"" and Request.Form("password")<>"" Thendim user,pwduser=request.form("username")pwd=request.form("password")sql="select * from user where user='"&user&"'"set rs=server.Createobject("adodb.recordset")rs.open sql,conn,1,1if rs.eof and rs.bof thenresponse.Write"无此用户"elseif rs("password")<>pwd thenresponse.Write"密码错误"elseresponse.cookies("userdata")=user&"|"&pwdResponse.Cookies("userlogin")=trueresponse.redirect("3.asp")end ifelseResponse.Write"请将表单填写完整"end ifend sub%>'这段是2.asp里面的代码用来处理表单并在客户端写入COOKIES<%if request.cookies("userlogin")=truethenresponse.write"您已经登陆了"elseresponse.Write"您尚未登陆!"end if%>'这段是3.asp用来验证是否登陆的代码
参考答案:else
response.cookies("userdata")=user&"|"&pwd
Response.Cookies("userlogin")=true
response.redirect("3.asp")
end if
else
Response.Write"请将表单填写完整"
end if
这段有问题。end if 你都结束语句了,怎么还来个else