![]() |
#2
zfy水2010-09-27 19:18
Syscode.asp代码 一部分代码消去了。。因为问题不在那。。
<!--#Include File="Check_Sql.asp"--> <!--#include file="Conn.asp"--> <!--#include file="Config.asp"--> <!--#include file="Ubbcode.asp"--> <!--#include file="Function.asp"--> <% dim strFileName,MaxPerPage,ShowSmallClassType dim totalPut,CurrentPage,TotalPages dim BeginTime,EndTime dim founderr, errmsg dim BigClassName,SmallClassName,SpecialName,keyword,strField dim rs,sql,sqlArticle,sqlDown,rsArticle,rsDown,sqlSearch,rsSearch,sqlBigClass,rsBigClass,sqlBigClass_Down,sqlSpecial,rsSpecial dim SpecialTotal BeginTime=Timer BigClassName=Trim(request("BigClassName")) SmallClassName=Trim(request("SmallClassName")) SpecialName=trim(request("SpecialName")) keyword=trim(request("keyword")) if keyword<>"" then keyword=replace(replace(replace(replace(keyword,"'","‘"),"<","<"),">",">")," "," ") end if strField=trim(request("Field")) if request("page")<>"" then currentPage=cint(request("page")) else currentPage=1 end if sqlBigClass="select * from BigClass order by BigClassID" Set rsBigClass= Server.CreateObject("ADODB.Recordset") rsBigClass.open sqlBigClass,conn,1,1 sqlBigClass_Down="select * from BigClass_Down order by BigClassID" Set rsBigClass_Down= Server.CreateObject("ADODB.Recordset") rsBigClass_Down.open sqlBigClass_Down,conn,1,1 '================================================= '过程名:ShowSmallClass_Tree '作 用:树形目录方式显示栏目 '参 数:无 '================================================= sub ShowSmallClass_Tree() if rsBigClass.bof and rsBigClass.eof then response.Write "栏目正在建设中……" else dim sqlClass,rsClass,strTree,BigClassNum,i,j rsBigClass.movefirst BigClassNum=rsBigClass.recordcount i=1 do while not rsBigClass.eof if i<BigClassNum then strTree="" else strTree="" end if sqlClass="select * from SmallClass where BigClassName='" & rsBigClass("BigClassName") & "' Order by SmallClassID" Set rsClass= Server.CreateObject("ADODB.Recordset") rsClass.open sqlClass,conn,1,1 strTree= strTree & "<table width=150 border=0 cellpadding=0 cellspacing=0>" strTree= strTree & "<tr>" strTree= strTree & "<td width=24 height=22>" strTree= strTree & "<div align=center>· </div></td>" strTree= strTree & "<td width=150>" strTree= strTree & "<a href='Products.asp?BigClassName=" & rsBigClass("BigClassName") & "'>" strTree=strTree & rsBigClass("BigClassName") strTree=strTree & "</a></td>" 'strTree=strTree & "</td>" strTree= strTree & "</tr><tr>" strTree=strTree & "<TD height=1 colspan=2 background=img/naSzarym.gif>" strTree=strTree & "<IMG height=1 src=img/1x1_pix.gif width=10></TD>" strTree=strTree & "</TR>" strTree=strTree & "</table>" SmallClassNum=rsClass.recordcount j=1 do while not rsClass.eof rsClass.movenext j=j+1 loop response.write strTree rsBigClass.movenext i=i+1 loop rsClass.close set rsClass=nothing end if end sub |
原因是我想去别的页面调用一个导航,但是直接代码调用时候结果图片不显示,发现是需要调用一个页面里面的函数,所以我就在页面复制了<!--#include file="Inc/Syscode.asp" -->运行时候出现了
Microsoft VBScript 编译器错误 '800a0411'
名称重定义
\wwwroot\150\Inc\Check_Sql.asp, line 3
check_sql.asp代码如下
<%
Dim Query_Badword,Form_Badword,i,Err_Message,Err_Web,name
'------定义部份 头----------------------------------------------------------------------
Err_Message = 1 '处理方式:1=提示信息,2=转向页面,3=先提示再转向
Err_Web = "Err.Asp" '出错时转向的页面
Query_Badword="'‖and‖select‖update‖chr‖delete‖%20from‖;‖insert‖mid‖master.‖set‖chr(37)‖="
'在这部份定义get非法参数,使用"‖"号间隔
Form_Badword="'‖%‖&‖*‖#‖(‖)‖=" '在这部份定义post非法参数,使用"‖"号间隔
'------定义部份 尾-----------------------------------------------------------------------
'
On Error Resume Next
'----- 对 get query 值 的过滤.
if request.QueryString<>"" then
Chk_badword=split(Query_Badword,"‖")
FOR EACH Query_Name IN Request.QueryString
for i=0 to ubound(Chk_badword)
If Instr(LCase(request.QueryString(Query_Name)),Chk_badword(i))<>0 Then
Select Case Err_Message
Case "1"
Response.Write "<Script Language=JavaScript>alert('传参错误!参数 "&name&" 的值中包含非法字符串!\n\n请不要在参数中出现:and
update delete ; insert mid master 等非法字符!');window.close();</Script>"
Case "2"
Response.Write "<Script Language=JavaScript>location.href='"&Err_Web&"'</Script>"
Case "3"
Response.Write "<Script Language=JavaScript>alert('传参错误!参数 "&name&"的值中包含非法字符串!\n\n请不要在参数中出现:and update
delete ; insert mid master 等非法字符!');location.href='"&Err_Web&"';</Script>"
End Select
Response.End
End If
NEXT
NEXT
End if
'-----对 post 表 单值的过滤.
if request.form<>"" then
Chk_badword=split(Form_Badword,"‖")
FOR EACH name IN Request.Form
for i=0 to ubound(Chk_badword)
If Instr(LCase(request.form(name)),Chk_badword(i))<>0 Then
Select Case Err_Message
Case "1"
Response.Write "<Script Language=JavaScript>alert('出错了!表单 "&name&" 的值中包含非法字符串!\n\n请不要在表单中出现: % & * # (
) 等非法字符!');window.close();</Script>"
Case "2"
Response.Write "<Script Language=JavaScript>location.href='"&Err_Web&"'</Script>"
Case "3"
Response.Write "<Script Language=JavaScript>alert('出错了!参数 "&name&"的值中包含非法字符串!\n\n请不要在表单中出现: % & * # ( )
等非法字符!');location.href='"&Err_Web&"';</Script>"
End Select
Response.End
End If
NEXT
NEXT
end if
%>
麻烦解答。。。
[ 本帖最后由 zfy水 于 2010-9-27 19:15 编辑 ]