有关cookies的小问题?(在线等候——)

yangsm 2003-08-30 05:36:48
我用COOKIES来判断用户是否登过,但总是说我没有登录。代码是:
<!--#include file="../wwwroot/common/z.txt"-->
<html>
<head>
<title><%=sitename%></title>
</head>
<body>
<%
user=trim(request.cookies("wwwroot")("name"))
if user<>"" then%>

<%
sql="select top 5 * from new order by id desc"
set mytext=mycon.execute(sql)
if mytext.eof or mytext.bof then
response.write"现在还没有新的内容!"
else
i=0
%>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<% do while not mytext.eof %>
<%response.write"<tr>"%>
<td width="100%"><% response.write mytext ("connect")%>
<% id=mytext("id")%><% id=mytext("id")%><a href="3.asp?id=<%=id%>">Enter
</a></td>

<% response.write"</tr>"%>
<%
i=i+1
mytext.movenext
loop
end if
mytext.close
mycon.close
%>

</table><% If i>=2 Then %>
<a href="index1.asp?type=sale"><font color="blue">
更多的信息</font></a>

<% End If %>
<%else%>
<table border="0" width="740" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="500" valign="top" align="center"><font color="#CCFF99"><b><font size="5">对不起,你不是本站的用户,你不查看信息!</font></b><font size="5"><b>!</b></font>.</font>
<p><font size="5" color="#00FF00"><a href="../user/addnew.asp">新用户注册</a></font><font color="#CCFF99"> 
</font><font size="5" color="#00FF00"><a href="../index.asp">登录</a></font></p>
</td>
</tr>
</table>
<% end if %>
</body>
</html>

还想请问一下,这个("user")代表什么?我现在也没有搞懂?
这个COOKIES是不是只要放在一个有用户注册的网站的的任何页面都可以用?
...全文
33 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
yangsm 2003-08-30
  • 打赏
  • 举报
回复
("user")也就是("wwwroot")要在客户端设置,要怎么做?
ceocio 2003-08-30
  • 打赏
  • 举报
回复
哪儿得("user")?
cookies需要客户端设置支持才行。

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧