当前位置: 代码迷 >> ASP >> 为什么总是出错呢解决办法
  详细解决方案

为什么总是出错呢解决办法

热度:180   发布时间:2012-03-07 09:13:51.0
为什么总是出错呢
<%     dim   ComeFrom,actCome,statuserid
statuserid=replace(Request.ServerVariables( "REMOTE_HOST "), ". ", " ")
set   rs=server.createobject( "adodb.recordset ")
if   membername= " "   then
if   session( "userid ")= " "   then
ComeFrom=address(Request.ServerVariables( "REMOTE_HOST "))
actCome=address(Request.ServerVariables( "HTTP_X_FORWARDED_FOR "))
sql= "insert   into   online(id,username,userclass,ip,startime,lastimebk,boardid,browser,stats,actforip,ComeFrom,actCome)   values   "&_
"( "&statuserid& ", '客人 ', '客人 ', ' "&_
Request.ServerVariables( "REMOTE_HOST ")& " ',Now(),Now(), "&boardid& ", ' "&_
Request.ServerVariables( "HTTP_USER_AGENT ")& " ', '论坛首页 ', ' "&_
                                Request.ServerVariables( "HTTP_X_FORWARDED_FOR ")& " ', ' "&ComeFrom& " ', ' "&actCome& " ') "
conn.execute(sql)
else
sql= "select   id   from   online   where   id= "&cstr(session( "userid "))
rs.open   sql,conn,1,3
if   rs.eof   and   rs.bof   then
ComeFrom=address(Request.ServerVariables( "REMOTE_HOST "))
actCome=address(Request.ServerVariables( "HTTP_X_FORWARDED_FOR "))
sql= "insert   into   online(id,username,userclass,ip,startime,lastimebk,boardid,browser,stats,actforip,ComeFrom,actCome)   values   "&_
"( "&statuserid& ", '客人 ', '客人 ', ' "&_
Request.ServerVariables( "REMOTE_HOST ")& " ',Now(),Now(), "&boardid& ", ' "&_
Request.ServerVariables( "HTTP_USER_AGENT ")& " ', '论坛首页 ', ' "&_
                                Request.ServerVariables( "HTTP_X_FORWARDED_FOR ")& " ', ' "&ComeFrom& " ', ' "&actCome& " ') "
conn.execute(sql)
else
sql= "update   online   set   lastimebk=Now(),boardid= "&boardid& "   where   id= "&cstr(session( "userid "))
conn.execute(sql)
end   if
end   if
session( "userid ")=statuserid
else
sql= "select   id   from   online   where   username= ' "&membername& " ' "
rs.open   sql,conn,1,3
if   rs.eof   and   rs.bof   then
ComeFrom=address(Request.ServerVariables( "REMOTE_HOST "))
actCome=address(Request.ServerVariables( "HTTP_X_FORWARDED_FOR "))
sql= "insert   into   online(id,username,userclass,ip,startime,lastimebk,boardid,browser,stats,actforip,ComeFrom,actCome)   values   "&_
"( "&statuserid& ", ' "&membername& " ', ' "&memberclass& " ', ' "&_
Request.ServerVariables( "REMOTE_HOST ")& " ',Now(),Now(), "&boardid& ", ' "&_
Request.ServerVariables( "HTTP_USER_AGENT ")& " ', '论坛首页 ', ' "&_
  相关解决方案