麻烦大家帮我解决一下这个问题

galaxyvenus 2004-03-24 03:36:49
http://www.softemail.net/hy/index001-2.asp

用户名:666666,密码:666666

为什么在这个网页的右边会员登陆框里登陆后,刷新一下就显示没有登陆了呢???

好你在右边登陆框里登陆后没有真正的写入cookiess一样

index001-2.asp里是iframe了huiyuan.asp

huiyuan.asp代码如下:

<link href="../images/index.css" rel="stylesheet" type="text/css">


<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style><table width="135" height="180" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" class="index01">
<tr>
<td width="148" height="30" bordercolor="#FFFFFF" bgcolor="0214B6"><div align="center" class="index">:: <b>会员登陆</b> ::</div></td>
</tr>
<tr>
<td width="141" height="100" bordercolor="#FFFFFF" class="index01">
<!--#include file="inc.asp"-->
<!--#include file="md5.asp"-->
<%


if request("action")="loginok" then



lgname=Replace(Request.Form("lgname"),"'","")
lgpwd=Replace(Request.Form("lgpwd"),"'","")
lgtype=Replace(Request.Form("lgtype"),"'","")
lgpwd=md5(lgpwd)






set lg=myconn.execute("select * from user where name='"&lgname&"' and password='"&lgpwd&"'")
if lg.eof and lg.bof then
Response.Cookies(cn)("lgname")=""
Response.Cookies(cn)("lgpwd")=""
Response.Cookies(cn)("lgtype")=""
response.cookies(cn&"2")("admin")=1



response.write"<span class='index01'><center>·登陆失败·</center></span><span class='index01'><center>你的用户名或密码错误</center></span>"
%>
<%

else
call getadmin()
response.write"<center><span class='index01'><b>·登陆成功·</b></span></center><span class='index01'><center>欢迎光临Softemail.net</center></span>"

end if
%>
<%end if%>
<!--#include file="conn.asp"-->
<form method="POST" name="login" action="huiyuan.asp?action=loginok">
<table width="135" height="100" border="0" cellpadding="0" cellspacing="0" class="index01">
<tr>
<%
set lg=myconn.execute("select * from user where name='"&lgname&"' and password='"&lgpwd&"'")
if lg.eof and lg.bof then
Response.Cookies(cn)("lgname")=""
Response.Cookies(cn)("lgpwd")=""
Response.Cookies(cn)("lgtype")=""
response.cookies(cn&"2")("admin")=1
%>



<td colspan="2"><%if lgname="" then%>

<span class='index01'>游客,您好。请登陆:</span></td>

<%
end if
%>
</tr>
<tr>
<td width="51">用户名:</td>
<td width="88"><input name="lgname" type="text" id="lgname" size="8"></td>
</tr>
<tr>
<td>密 码:</td>
<td><input name="lgpwd" type="text" id="lgpwd" size="8"></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="提交">
 
<input type="reset" name="Submit2" value="重写">
</div></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td height="12" bordercolor="#FFFFFF" class="index01"><div align="center">
<table width="135" height="21" border="0" cellpadding="0" cellspacing="0">
<tr>


<%
set bbs1=myconn.execute("select * from bbsinfo")

regno=bbs1("usernum")
set bbs1=nothing
%>
<td><span class='index01'>注册会员:<%=regno%>人</span></td>

<%
riqi=now+timeset/24
myconn.execute("delete*from online where ltime<now+"×et&"/24-0.05")

if lgname="" then
set jilu=myconn.execute("select ip from online where ip='"&ip&"'")
if jilu.eof then
myconn.execute("insert into online (ip,ltime,pic)VALUES('"&ip&"','"&riqi&"',"&admin&")")
else
myconn.execute("update online set ltime='"&riqi&"' where ip='"&ip&"'")
end if
set jilu=nothing
end if
if lgname<>"" then
set ujilu=myconn.execute("select name from online where name='"&lgname&"'")
if ujilu.eof then
myconn.execute("delete*from online where ip='"&ip&"'")
myconn.execute("insert into online (name,ip,ltime,pic)VALUES('"&lgname&"','"&ip&"','"&riqi&"',"&admin&")")
else
myconn.execute("update online set ltime='"&riqi&"' where name='"&lgname&"'")
end if
set ujilu=nothing
end if
...全文
127 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhfkhx 2004-03-24
  • 打赏
  • 举报
回复
认真学习,对于认证来说太有参考价值了
jasonboy 2004-03-24
  • 打赏
  • 举报
回复
学习
歪歪 2004-03-24
  • 打赏
  • 举报
回复
也可:Response.Cookies("lgname")=lgname

:)
xzq686 2004-03-24
  • 打赏
  • 举报
回复
可以呀!
用666666登录后刷新一下没有提示再次登录!
pizixt 2004-03-24
  • 打赏
  • 举报
回复
cn是字典? 加引号
Response.Cookies("cn")("lgname")=lgname
pizixt 2004-03-24
  • 打赏
  • 举报
回复
写Cookies
Response.Cookies(cn)("lgname")=lgname
Response.Cookies(cn)("lgpwd")=lgpwd
Response.Cookies(cn)("lgtype")=lgtype
pizixt 2004-03-24
  • 打赏
  • 举报
回复
getadmin()这个过程在哪里?
你的Cookies判断在哪里?
galaxyvenus 2004-03-24
  • 打赏
  • 举报
回复
麻烦各位朋友给看一下,谢谢了
galaxyvenus 2004-03-24
  • 打赏
  • 举报
回复
那怎么登陆后写进去呢???

麻烦你给写代码吧 ,我是ASP新手
sheng9hhd 2004-03-24
  • 打赏
  • 举报
回复
你cookie里登陆后没有写值进去!
galaxyvenus 2004-03-24
  • 打赏
  • 举报
回复
麻烦大家给看一下,非常感谢了。

galaxyvenus 2004-03-24
  • 打赏
  • 举报
回复

mostonline=myconn.execute("select mostonline from bbsinfo")(0)
usno=myconn.execute("Select count(ltime)from online where name<>''")(0)
lineno=myconn.execute("Select count(ltime)from online")(0)
if int(lineno)>int(mostonline) then
myconn.execute("update bbsinfo set mostonline="&lineno&"")
mostonline=lineno
end if
nusno=lineno-usno
%>
<td><span class='index01'>在线人数:<%=lineno%>人</span></td>

<%
ni=1
ha=1
set useol=myconn.execute("select*from online order by name desc")
do while not useol.eof
if ni>lineno then exit do
useol.movenext
Loop
useol.Close
set useol=nothing
set usno=nothing
set lineno=nothing
%>
</tr>
</table>
</div></td>
</tr>
<tr>
<td height="12" bordercolor="#FFFFFF" class="index01"><div align="center"><img src="../images/index24.gif" width="6" height="6"><a href="zhuce.asp" class="unlink01" target="softemail"><b>免费注册</b></a><img src="../images/index24.gif" width="6" height="6"><a href="getpwd.asp" class="unlink01" target="softemail"><b>找回密码</b></a><img src="../images/index24.gif" width="6" height="6"></div></td>
</tr>
</table>

<%
else
set rs=myconn.execute("select*from [user] where name='"&lgname&"'")
q1=rs("qian")
m1=rs("meili")
j1=rs("jingyan")
ties=rs("bbsnum")
%>
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='135'>
<tr>

<%set rs=nothing%>
<td width='66%'>
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='135'>
<tr>
<td width='100%' colspan='2'><span class='index01'>欢迎您,<a href='userinfo.asp?name=<%=lgname%>' title='查看 我自己 的详细资料' target='softemail'><%=lgname%></a></span></td>
<%
set seegg2=nothing
set bbs1=myconn.execute("select * from bbsinfo")
newuser=bbs1("newuser")
regno=bbs1("usernum")
tienoa=bbs1("bbsnum")
tieno=bbs1("topicnum")
mosttopic=bbs1("mosttopic")
mostonline=bbs1("mostonline")
todaynum=bbs1("todaynum")
set bbs1=nothing
%>

</tr>
<tr>
<td width='50%' height="19"><span class='index01'>注册会员:<%=regno%>人</span></td>
<td width='50%' height="19"><span class='index01'>总信息数:<%=tienoa%>条</span></td>
</tr>
<tr>
<td width='50%'><a href='huiyuan.asp?action=exit' target="_self"><span class='unlink01'>退出系统</span></a></td>
</td>



<%
riqi=now+timeset/24
myconn.execute("delete*from online where ltime<now+"×et&"/24-0.05")

if lgname="" then
set jilu=myconn.execute("select ip from online where ip='"&ip&"'")
if jilu.eof then
myconn.execute("insert into online (ip,ltime,pic)VALUES('"&ip&"','"&riqi&"',"&admin&")")
else
myconn.execute("update online set ltime='"&riqi&"' where ip='"&ip&"'")
end if
set jilu=nothing
end if
if lgname<>"" then
set ujilu=myconn.execute("select name from online where name='"&lgname&"'")
if ujilu.eof then
myconn.execute("delete*from online where ip='"&ip&"'")
myconn.execute("insert into online (name,ip,ltime,pic)VALUES('"&lgname&"','"&ip&"','"&riqi&"',"&admin&")")
else
myconn.execute("update online set ltime='"&riqi&"' where name='"&lgname&"'")
end if
set ujilu=nothing
end if

mostonline=myconn.execute("select mostonline from bbsinfo")(0)
usno=myconn.execute("Select count(ltime)from online where name<>''")(0)
lineno=myconn.execute("Select count(ltime)from online")(0)
if int(lineno)>int(mostonline) then
myconn.execute("update bbsinfo set mostonline="&lineno&"")
mostonline=lineno
end if
nusno=lineno-usno
%>
<td height=25 width=50% ><span class='index01'>在线人数:<%=lineno%>人</span></td>
</tr>

</table>
</td>
</tr>
</table>

<%
ni=1
ha=1
set useol=myconn.execute("select*from online order by name desc")
do while not useol.eof
if ni>lineno then exit do
useol.movenext
Loop
useol.Close
set useol=nothing
set usno=nothing
set lineno=nothing
%>

<%end if%>
<%
if request("action")="exit" then

myconn.execute("delete*from online where name='"&request.cookies(cn)("lgname")&"'")
Response.Cookies(cn)("lgname")=""
Response.Cookies(cn)("lgpwd")=""
response.cookies(cn&"2")("admin")=1

end if
%>

28,390

社区成员

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

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