日期:2014-05-17  浏览次数:21128 次

我研究了几天还是不懂,还望高手帮忙指点!谢谢!
我用ASP做一个BBS系统,其中用下拉列表统计在线用户,本来要达到的效果是:通过下列表选中用户名然后转到guestinfo.asp查看该用户的信息.可是结果功能没达到,下面的代码我也不知道那里错了,帮我看看好吗?谢谢了.

<%  
  Set   conn=Server.CreateObject( "ADODB.Connection ")

connstr= "Provider=SQLOLEDB.1;Password=123456;Persist   Security   Info=True;User   ID=sa;Initial   Catalog=shujuku;Data   Source=(local);Connect   Timeout=15 "  
conn.Open   connstr
set   rs=server.CreateObject( "adodb.recordset ")
serialnum=request.querystring( "serialnum ")
query= "select*from   currentuser   where   serialnum= ' "&serialnum& " ' "
rs.open   query,conn,1,3
 
%>      
<%check   =request( "serialnum ")%>

<html>

<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<meta   http-equiv= "refresh "   content= "10;url=userlist.asp?serialnum= <%=request( "serialnum ")%> ">
<title> 当前用户列表 </title>
<style   type= "text/css ">
<!--
a:visited,a:link{text-decoration:none;color:#003399}
a:hover{text-decoration:none;color:#3333ff}
a.linkwhite:link,a.linkwhite:visited{text-decoration:none;color:white}
a.linkwhite:hover{text-decoration:underline;color:white}
a.linkblack:link,a.linkblack:visited{text-decoration:none;color:black}
a.linkblack:hover{text-decoration:underline;color:black}
input{font-family: "宋体 ";font-size:9pt}
td{font-family: "宋体 ";font-size:9pt;color:#000000}
.en{font-family: "verdana ", "arial ";font-size:9pt}
.white{color:#ffffff}
.line{line-height:20px}
.title{font-size:14px}
-->
</style>

<%
sql= "select   *   from   ever_user   where   uid   in( "
sql=sql& "select   uid   from   currentuser   where   serialnum= ' "&request( "serialnum ")& " ') "
set   save_rs=conn.execute(sql)
    if   save_rs.eof   or   save_rs.bof   then
            response.write "你的帐号已经过期,请重新登录或注册新的用户。 <br> "
    response.end
    else
            if   isnull(save_rs( "totaltime "))then
    totaltime=0
      else
              totaltime=save_rs( "totaltime ")
      end   if
      totaltime=totaltime+1
      sql= "update   ever_user   set   totaltime= ' "&totaltime& " '   where   uid= ' "&save_rs( "uid ")& " ' "
      conn.execute(sql)
    end   if
    set   currentuserrs=conn.execute( "select*from   currentuser ")
    set   newfile=conn.execute( "select*from   new_essay ")
     
      on   error   resume   next
      currentuserrs.movefirst
      newfile.movefirst
      if   not   currentusers.eof   then
      %>