中易网

帮我看看此段代码哪里错了

答案:2  悬赏:60  
解决时间 2021-04-27 18:05

spupok.asp 上传代码  我不知道怎么搞了 老显示500  错误

 

代码是

 

 

<!--#include file="upconn.asp"-->
<!--#include file="usercookies.asp"-->
<%Server.ScriptTimeOut=5000%>
<!--#include file="config.asp"-->
<!--#include file = "foxx.inc"-->
<%
if instr(request.servervariables("http_referer"),"http://"&request.servervariables("host") )<1 then
response.write "处理 URL 时服务器上出错。<br>非法攻击服务器,你的所有操作及ID已经被服务器记录。<br>我们会第一时间通知公安局网监来调查你的IP。 "
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")
 huitype=upload.form("huitype")
 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("shopupfiles") & "\" & 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_shop where username='"&username&"' and xxid='"&xxid&"'"
rs.open sql,conn,1,3
if session("addxinxi")<>"" then
  if DateDiff("s",session("addxinxi"),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='shopupfiles/"&FileName&"'>查看</a>"
%> 

最佳答案
你空间支持FSO组件吗?
全部回答
从安一下游戏吧!
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
人为啥要干活
csol2下载好了是不是只有两个文件官网下的
警察是干什么的?入室盗窃案不归他们管吗?
你好,请问下月经期间可以拔火罐和中式保健按
怎样做才是一个媳妇应该做的事呢?
有人忽悠我参与安利直销,我该怎么办他?
叶问2宗师传奇不是上映了吗怎么找不到啊
农场中的两个最
如何装饰墙壁
花苑小区(招村花苑街)地址有知道的么?有点事
龙南到深圳要多少车费?
我以前3250手机上的内存卡现放5700的机子上不
笔记本开机报风扇怎么修
谁会这些问题?
如何才能学好知识
推荐资讯
八年级上北师大版数学第一,第二章的知识点
dnf鬼泣瘟疫和鬼影闪加多少
心情很糟糕,快崩溃了,我该怎么办??
孕39+3天,今天早晨起来怎么好多白带,是透明
关于维度的几个问题
QQ三国怎么老被人P
电费单和电表度数不一样怎么办
1994年5月18日出生是什么血型
津味早点地址有知道的么?有点事想过去
为什么一上就掉线啊
怎么QQ会员VIP2怎么还是不会加速升级啊.?
国庆节该送什么东西给女朋友更合适呢?
手机登qq时,显示手机磁盘不足,清理后重新登
刺客的套装怎么选啊?