后台传图片时出个错高手帮帮忙 Microsoft VBScript 运行时错误 '800a01f4' 变量未定义: 'sjCat_Upload' \web\admin\ziupok.asp, line 18 Host by NetBox Version 2.8 Build 4128
源代码帮帮看哪错了?
<!--#include file="upconn.asp"-->
<!--#include file="cookies.asp"-->
<%Server.ScriptTimeOut=5000%>
<!--#include file="../config.asp"-->
<!--#include file = "../foxx.inc"-->
<%
dim flag
flag=request.cookies("foxwww")("fox")
if flag=10 then
response.Write "<script LANGUAGE='javascript'>alert('您只是后台测试员,请注意身份!');window.location='right.asp';</script>"
response.end
end if
%>
<%
dim upload,file,formElement,formFile,iCount,fileExt,xxid,username,huitype,formPath,rs,sql,filename
iCount=0
set upload = new sjCat_Upload
Set file = upload.file("file1")
username=upload.form("username")
xxid=upload.form("xxid")
if file.filesize<1 then
response.write "<font size=2>请先选择你要上传的图片 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
response.end
end if
fileExt=lcase(right(file.filename,4))
if fileEXT<>".gif" and fileEXT<>".jpg" and fileEXT<>".bmp" then
response.write "<font size=2>文件格式不对 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
response.end
end if
if file.filesize>1024000 then '这是1000K的图片大小数据
response.write "<font size=2>图片大小超过了限制(不大于100K) [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
response.end
end if
filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&fileExt
if file.FileSize>0 then
file.Save2File Server.mappath("..\newsupfiles") & "\" & FileName
iCount=iCount+1
end if
set file=nothing
set upload=nothing
if xxid="" then
Response.Write"<li>您操作参数错误!"
response.end
end if
if username="" then
Response.Write"<li>您操作参数错误!"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql = "select xinxipic,xxid,username from FOX_zixun where username='"&username&"' and xxid='"&xxid&"'"
rs.open sql,conn,1,3
if session("addzixun")<>"" then
if DateDiff("s",session("addzixun"),Now())<180 then
response.write "<script>alert('系统保护:你提交数据太快,系统中止运行,请等待180秒钟!!');history.go(-1);</SCRIPT>"
response.end
end if
end if
if not rs.eof or not rs.bof then
if trim(rs("xxid"))=xxid then
Response.Write"<li>您操作参数错误!"
response.end
end if
else
rs.addnew
rs("username")=username
rs("xxid")=xxid
rs("xinxipic")=filename
rs.update
end if
rs.close
set rs=nothing
if huitype=1 then
set rs=server.createobject("adodb.recordset")
sql = "select dxb from FOX_user where username='"&username&"'"
rs.open sql,conn,1,3
rs("dxb")=rs("dxb")-tdxb
rs.update
rs.close
set rs=nothing
end if
closedb
response.write "图片成功上传!"
response.write "<a target='_blank' href='../newsupfiles/"&FileName&"'>查看</a>"
%>
不懂代码谢谢了~~~~~~~~ |