add_save.asp
来自「国内第一数字点卡销售程序。功能强大。 完整无错!数据文件经MD5加密!经严格测」· ASP 代码 · 共 128 行
ASP
128 行
<!--#include FILE="upload_5xsoft.inc"-->
<!--#include file="conn.asp"-->
<html>
<body>
<%
if session("admin_rank")<>1 and session("admin_rank")<>4 then
response.write("<script>alert('您无权查看本页,SORRY!');window.location=('login.asp')</script>")
response.end
end if
%>
<%
function htmlencode(str)
htmlencode=replace(replace(replace(str,chr(13),"<br>"),"'","''"),chr(32)," ")
end function
%>
<%
function modifycode(str)
modifycode=replace(replace(replace(str,"<br>",chr(13)),"'","''")," ",chr(32))
end function
%>
<%
dim upload,file,formName,formPath,iCount,gsid,filename,rs,sql,picture
dim sort_id,hw_name,hw_cash,hw_cash1,hw_content,hw_jp,hw_xp,hw_rm,hw_rx,hw_cz
set upload=new upload_5xSoft
function MakedownName()
dim fname
fname = now()
fname = replace(fname,"-","")
fname = replace(fname," ","")
fname = replace(fname,":","")
fname = replace(fname,"PM","")
fname = replace(fname,"AM","")
fname = replace(fname,"上午","")
fname = replace(fname,"下午","")
fname = int(fname) + int((10-1+1)*Rnd + 1)
MakedownName=fname
end function
formPath=upload.form("filepath")
if right(formPath,1)<>"/" then formPath=formPath&"/"
anclassid=upload.form("anclassid")
Nclassid=upload.form("Nclassid")
if anclassid<>"" and Nclassid<>"" then
hw_name=upload.form("hw_name")
hw_cz=upload.form("hw_cz")
hw_jj=upload.form("hw_jj")
hw_cash=upload.form("hw_cash")
hw_cash1=upload.form("hw_cash1")
hw_cash2=upload.form("hw_cash2")
hw_cash3=upload.form("hw_cash3")
if hw_cash1="" or hw_cash2="" or hw_cash3="" or hw_cash="" or hw_name="" then
response.write "<script language=javascript>alert('参数添写的不够全面,请审核后再填!');history.go(-1);</script>"
response.End
end if
hw_content=upload.form("hw_content")
hw_xp=upload.form("hw_xp")
hw_jp=upload.form("hw_jp")
hw_rm=upload.form("hw_rm")
hw_rx=upload.form("hw_rx")
hw_hostweb=upload.form("hw_hostweb")
hw_downweb=upload.form("hw_downweb")
hw_service=upload.form("hw_service")
iCount=0
for each formName in upload.file
set file=upload.file(formName)
if file.FileSize>0 then
if file.filesize>200000 then
response.write "<script language=javascript>alert('图片大于200K请上传小于200K图片!');history.go(-1);</script>"
response.End
else
if trim(right(file.FileName,4))<>".jpg" and trim(right(file.FileName,4))<>".gif" then
response.write "<script language=javascript>alert('请上传jpg或gif为后缀的图片,且文件名为小写!');history.go(-1);</script>"
response.End
else
FileName=MakedownName()&"."&mid(file.FileName,InStrRev(file.FileName, ".")+1)
formPath="../picture/"
file.SaveAs Server.mappath(formPath&FileName)
picture=FileName
iCount=iCount+1
set rs=server.createobject("adodb.recordset")
hw_name=srequest(hw_name,0)
sql="select * from hw where hw_name='"&hw_name&"'"
rs.open sql,conn,3,3
if not rs.eof then
response.write "<script language=javascript>alert('数据库已有该产品,请审核!');history.go(-1);</script>"
response.End
end if
rs.addnew
rs("hw_name")=hw_name
rs("hw_cz")=hw_cz
rs("hw_content")=htmlencode(hw_content)
rs("hw_jj")=hw_jj
rs("hw_cash")=hw_cash
rs("hw_cash")=hw_cash
rs("hw_cash1")=hw_cash1
rs("hw_cash2")=hw_cash2
rs("hw_cash3")=hw_cash3
rs("hw_hostweb")=hw_hostweb
rs("hw_downweb")=hw_downweb
rs("hw_service")=hw_service
rs("anclassid")=int(anclassid)
rs("Nclassid")=int(Nclassid)
rs("hw_pic")=picture
rs("hw_date")=Now()
rs("hw_xp")=cbool(cint(hw_xp))
rs("hw_jp")=cbool(cint(hw_jp))
rs("hw_rm")=cbool(cint(hw_rm))
rs("hw_rx")=cbool(cint(hw_rx))
rs.update
rs.close
set upload=nothing
response.write("<script>alert('产品添加成功!');window.location=('addhw.asp')</script>")
response.end
end if
end if
end if
set file=nothing
next
response.write"<SCRIPT language=JavaScript>alert('对不起,您上传的图片有错误,请检查!!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
else
response.write "<script language=javascript>alert('商品大类别或小类别为空不能添加!后退!');history.go(-1);</script>"
response.End
end if%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?