当前位置:编程学习 > asp >>

帮我看看这个asp文件哪里出错了谢谢

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <%option explicit%>
  3. <!--#include file="KS_Cls/Kesion.AppCls.asp"-->
  4. <%
  5. '****************************************************
  6. ' Software name:Kesion CMS 7.0
  7. ' Email: service@kesion.com . QQ:111394,9537636
  8. ' Web: http://www.kesion.com http://www.kesion.cn
  9. ' Copyright (C) Kesion Network All Rights Reserved.
  10. '****************************************************
  11. Dim KSCls
  12. Set KSCls = New SiteIndex
  13. KSCls.Kesion()
  14. Set KSCls = Nothing
  15. Const AllowSecondDomain=true '是否允许开启空间二级域名 true-开启 false-不开启
  16. Class SiteIndex
  17. Private KS,AppCls
  18. Private Sub Class_Initialize()
  19. If (Not Response.IsClientConnected)Then
  20. Response.Clear
  21. Response.End
  22. End If
  23. Set AppCls=New KesionAppCls
  24. Set KS=New PublicCls
  25. End Sub
  26. Private Sub Class_Terminate()
  27. Set KS=Nothing
  28. Set AppCls=Nothing
  29. Call CloseConn()
  30. End Sub
  31. Public Sub Kesion()
  32. '================================判断自动生成==============================
  33. Const PerTime=2 '自动生成间隔的时间数,单位为分钟。
  34. Dim Template,KSR,LastModified,FsoIndex:FsoIndex=KS.Setting(5)
  35. If PerTime>0 and Split(FsoIndex,".")(1)<>"asp" Then
  36. Set KSR = New Refresh
  37. Dim fs:set fs=Server.CreateObject(KS.Setting(99))
  38. If KS.CheckFile(KS.Setting(5))=false Then
  39. LastModified="1990-1-1"
  40. Else
  41. Dim f:set f=fs.getfile(server.MapPath(KS.Setting(5)))
  42. LastModified=f.DateLastModified
  43. End If
  44. if datediff("n",LastModified,Now)>=PerTime Then
  45. Template = KSR.LoadTemplate(KS.Setting(110))
  46. FCls.RefreshType = "INDEX" '设置刷新类型,以便取得当前位置导航等
  47. FCls.RefreshFolderID = "0" '设置当前刷新目录ID 为"0" 以取得通用标签
  48. Template=KSR.KSLabelReplaceAll(Template)
  49. Call KS.WriteTOFile(KS.Setting(5),Template)
  50. Set KSR=Nothing
  51. End If
  52. End If
  53. '===================================自动生成结束======================================
  54. If AllowSecondDomain=True And KS.IsNul(Request.QueryString("do")) Then
  55. SecondDomain
  56. Else
  57. Call AppCls.HomePage()
  58. End If
  59. End Sub
  60. Public Sub SecondDomain()
  61. dim From,gourl,sdomain,title,username,domain
  62. From = LCase(Request.ServerVariables("HTTP_HOST"))
  63. sdomain = LCase(KS.SSetting(15))
  64. sdomain = Replace(sdomain,"http://","")
  65. sdomain = Replace(sdomain,"/","")
  66. dim domain1,domain2
  67. domain = LCase (from)
  68. domain = Replace (domain,"http://","")
  69. domain = Replace (domain,"/","")
  70. If lcase(domain)=lcase(KS.Setting(69)) or lcase(domain)=lcase(KS.JSetting(41)) or (sdomain=domain and sdomain<>"") Then '小论坛
  71. Call AppCls.Domain(domain)
  72. Exit Sub
  73. else
  74. domain1= Replace (Left (domain,InStr (domain,".")),".","")
  75. if Trim (domain1)="" or (domain1="www" and domain=replace(lcase(KS.Setting(2)),"http://","")) or (Request.ServerVariables("HTTP_HOST")="http://" & KS.Setting(2)) or ("http://" & lcase(Request.ServerVariables("HTTP_HOST"))=lcase(KS.Setting(2))) Then
  76. Call AppCls.HomePage() : Exit Sub
  77. Else
  78. '=====================这里定义其它系统非个人空间的二级域名转向,如论坛等=============================
  79. if instr(Request.ServerVariables("SERVER_NAME"),"bbs.XXX.com")>0 then
  80. response.redirect KS.GetDomain & "club/index.asp"

  81. '===我改动的部分===

  82. elseif instr(Request.ServerVariables("HTTP_ACCEPT"),"text/vnd.wap.wml")>0 then

  83. response.redirect KS.GetDomain & "wap/" '我主要是想让网站如果手机访问自己动跳转到wap目录这句好像跟这上面的内容有冲突不起作用,请问在怎么改
  84. '===出错的代码===

  85. elseif instr(Request.ServerVariables("SERVER_NAME"),"wap.XXX.com")>0 Then

  86. if instr(Request.ServerVariables("HTTP_ACCEPT"),"text/vnd.wap.wml")>0 then
  87. response.redirect KS.GetDomain & "wap" '这里我是想要手机访问自动跳转到网站WAP地址
  88. else
  89. response.redirect KS.GetDomain & "wapmo" '而电脑用这个wap.XXX.com的域名访问则跳转到网站WEB地址,这里我的想法是做个wap模拟页面

  90. elseif instr(Request.ServerVariables("SERVER_NAME"),"3g.XXX.com")>0 Then
  91. if instr(Request.ServerVariables("HTTP_ACCEPT"),"text/vnd.wap.wml")>0 then
  92. response.redirect KS.GetDomain & "wap" '网站WAP地址 这里同上
  93. else
  94. response.redirect KS.GetDomain & "wapmo" '网站WEB地址

  95. '===出错的代码===

  96. '===我改动的部分结束===

  97. end if
  98. '============================================================================
  99. End If
  100. Set AppCls=New KesionAppCls
  101. if instr(domain,replace(replace(lcase(KS.Setting(2)),"http://",""),"www.",""))=0 and domain1="www" then
  102. Call AppCls.Domain(domain)
  103. else
  104. Call AppCls.Domain(domain1)
  105. end if
  106. Exit Sub
  107. end if
  108. End Sub
  109. End Class
  110. %>
补充:
  • Public Sub SecondDomain()
  • dim From,gourl,sdomain,title,username,domain
  • From = LCase(Request.ServerVariables("HTTP_HOST"))
  • sdomain = LCase(KS.SSetting(15))
  • sdomain = Replace(sdomain,"http://","")
  • sdomain = Replace(sdomain,"/","")
  • dim domain1,domain2
  • domain = LCase (from)
  • domain = Replace (domain,"http://","")
  • domain = Replace (domain,"/","")
  • If lcase(domain)=lcase(KS.Setting(69)) or lcase(domain)=lcase(KS.JSetting(41)) or (sdomain=domain and sdomain<>"") Then '小论坛
  • Call AppCls.Domain(domain)
  • Exit Sub
  • else
  • domain1= Replace (Left (domain,InStr (domain,".")),".","")
  • if Trim (domain1)="" or (domain1="www" and domain=replace(lcase(KS.Setting(2)),"http://","")) or (Request.ServerVariables("HTTP_HOST")="http://" & KS.Setting(2)) or ("http://" & lcase(Request.ServerVariables("HTTP_HOST"))=lcase(KS.Setting(2))) Then
  • Call AppCls.HomePage() : Exit Sub
  • Else
  • '=====================这里定义其它系统非个人空间的二级域名转向,如论坛等=============================
  • if instr(Request.ServerVariables("SERVER_NAME"),"bbs.XXX.com")>0 then
  • response.redirect KS.GetDomain & "club/index.asp"

  • '===我改动的部分===

  • elseif instr(Request.ServerVariables("HTTP_ACCEPT"),"text/vnd.wap.wml")>0 then

  • response.redirect KS.GetDomain & "wap/" '我主要是想让网站如果手机访问自己动跳转到wap目录这句好像跟这上面的内容有冲突不起作用,请问在怎么改
  • '===出错的代码===

  • elseif instr(Request.ServerVariables("SERVER_NAME"),"wap.XXX.com")>0 Then

  • if instr(Request.ServerVariables("HTTP_ACCEPT"),"text/vnd.wap.wml")>0 then
  • response.redirect KS.GetDomain & "wap" '这里我是想要手机访问自动跳转到网站WAP地址
  • else
  • response.redirect KS.GetDomain & "wapmo" '而电脑用这个wap.XXX.com的域名访问则跳转到网站WEB地址,这里我的想法是做个wap模拟页面

  • elseif instr(Request.ServerVariables("SERVER_NAME"),"3g.XXX.com")>0 Then
  • if instr(Request.ServerVariables("HTTP_ACCEPT"),"text/vnd.wap.wml")>0 then
  • response.redirect KS.GetDomain & "wap" '网站WAP地址 这里同上
  • else
  • response.redirect KS.GetDomain & "wapmo" '网站WEB地址

  • '===出错的代码===

  • '===我改动的部分结束===

  • end if
  • '============================================================================
  • End If
  • Set AppCls=New KesionAppCls
  • if instr(domain,replace(replace(lcase(KS.Setting(2)),"http://",""),"www.",""))=0 and domain1="www" then
  • Call AppCls.Domain(domain)
  • else
  • Call AppCls.Domain(domain1)
  • end if
  • Exit Sub
  • end if
  • End Sub
  • End Class
  • %>
  •  

    主要是这一段代码

    追问:好像你改动的没起做用,加QQ帮我解决一下吧!
    答案:把你的这部分替换成我的

    '=====================这里定义其它系统非个人空间的二级域名转向,如论坛等=============================
    if instr(Request.ServerVariables("SERVER_NAME"),"bbs.XXX.com")>0 then
    response.redirect KS.GetDomain & "club/index.asp"


    '===我改动的部分===

    elseif instr(Request.ServerVariables("HTTP_ACCEPT"),"text/vnd.wap.wml")>0 then

    response.redirect KS.GetDomain & "wap/" '我主要是想让网站如果手机访问自己动跳转到wap目录这句好像跟这上面的内容有冲突不起作用,请问在怎么改

    '===出错的代码===

    elseif instr(Request.ServerVariables("SERVER_NAME"),"wap.XXX.com")>0 Then

    if instr(Request.ServerVariables("HTTP_ACCEPT"),"text/vnd.wap.wml")>0 then
    response.redirect KS.GetDomain & "wap" '这里我是想要手机访问自动跳转到网站WAP地址
    else
    response.redirect KS.GetDomain & "wapmo" '而电脑用这个wap.XXX.com的域名访问则跳转到网站WEB地址,这里我的想法是做个wap模拟页面


    elseif instr(Request.ServerVariables("SERVER_NAME"),"3g.XXX.com")>0 Then
    if instr(Request.ServerVariables("HTTP_ACCEPT"),"text/vnd.wap.wml")>0 then
    response.redirect KS.GetDomain & "wap" '网站WAP地址 这里同上
    else
    response.redirect KS.GetDomain & "wapmo" '网站WEB地址

    '===出错的代码===

    '===我改动的部分结束===

    end if

    上面是你的

    下面是我改的

    '=====================这里定义其它系统非个人空间的二级域名转向,如论坛等=============================
    if instr(Request.ServerVariables("SERVER_NAME"),"bbs.XXX.com")>0 then
    response.redirect KS.GetDomain & "club/index.asp"


    '===我改动的部分===
    end if
    if instr(Request.ServerVariables("HTTP_ACCEPT"),"text/vnd.wap.wml")>0 then

    response.redirect KS.GetDomain & "wap/" '我主要是想让网站如果手机访问自己动跳转到wap目录这句好像跟这上面的内容有冲突不起作用,请问在怎么改

    '===出错的代码===

    end if
    if instr(Request.ServerVariables("SERVER_NAME"),"wap.XXX.com")>0 Then

     if instr(Request.ServerVariables("HTTP_ACCEPT"),"text/vnd.wap.wml")>0 then
     response.redirect KS.GetDomain & "wap" '这里我是想要手机访问自动跳转到网站WAP地址
     else
     response.redirect KS.GetDomain & "wapmo" '而电脑用这个wap.XXX.com的域名访问则跳转到网站WEB地址,这里我的想法是做个wap模拟页面
     end if

     if instr(Request.ServerVariables("SERVER_NAME"),"3g.XXX.com")>0 Then
      if instr(Request.ServerVariables("HTTP_ACCEPT"),"text/vnd.wap.wml")>0 then
      response.redirect KS.GetDomain & "wap" '网站WAP地址 这里同上
      else
      response.redirect KS.GetDomain & "wapmo" '网站WEB地址
      
      '===出错的代码===
      
      '===我改动的部分结束===
      
      end if
     end if
    end if

    程序没有提示哪行出错?你这样给人回答,谁也不会回答。这个是科讯的系统,一般程序不会有错,看你的配置吧。
    页面的错误提示整出来一下就有人回答了

    上一个:求用asp编写的最简单的聊天室
    下一个:asp分页,请高手求救

    CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
    部分文章来自网络,