/* addemployee.ASP */
| 标题: | |
| 分类: | |
| 正文: | |
| 图片: | |
| 1、您上传的图片大小请控制在500K以内,否则不允许上传 | |
| | |
/* transact1.asp*/
<!--#include file="../func/conn.inc"-->
<!--#include file="../func/fUPLOAD.inc"-->
<!--#include file ="../func/myfunctions.inc"-->
<%
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Dim Fields
Dim strTitle,strSort,strContent
Dim rs,ssql
Dim iMaxid
Dim strMaxid
Dim strlen
Set Fields = GetUpload()
strTitle=BinaryToString(Fields("txtTitle").value)
strSort=BinaryToString(Fields("txtSort").value)
strContent=BinaryToString(Fields("txtContent").value)
strSort=split(trim(strSort),"-")
if instr(1,lcase(Fields("file").FileName),".jpg")=0 and instr(1,lcase(Fields("file").FileName),".gif")=0 then
response.write ""
response.write ""
Response.end
end if
if Fields("file").Length>500000 then
response.write ""
response.write ""
response.end
end if
'/*存至数据库*/
if Fields("file").FileName<>"" then
Set rs=Server.Createobject("ADOdb.Recordset")
sSql="select * from employee order by id desc"
rs.open sSql,conn,2,2
if not rs.eof then
iMaxid=Clng(rs("id"))+1
strlen=4-len(cstr(iMaxid))
strMaxid=string(strlen,"0") & cstr(iMaxid)
else
strMaxid="0001"
end if
rs.addnew
rs("id")=strMaxid
rs("title")=strTitle
rs("sort")=strSort(0)
rs("img").AppendChunk Fields("file").Value
rs("content")=quoteChg(strContent)
rs("todate")=date()
rs.update
rs.close
response.write ""
end if
end if
%>
**********************************************************************
/*fupload.inc*/
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10752019/viewspace-982083/ ,如需转载,请注明出处,否则将追究法律责任。