List_Save.asp
资源名称:NetPhone.rar [点击查看]
上传用户:xxtaishan
上传日期:2022-01-02
资源大小:4063k
文件大小:2k
源码类别:
IP电话/视频会议
开发平台:
ASP/ASPX
- <!--#include file="../../inc/conn.asp"-->
- <!--#include file="../../inc/FUNC.asp" -->
- <!--#include file="../../inc/upload_5xsoft.inc" -->
- <%
- '-----------------------------
- DIM UPLOAD
- SET UPLOAD=NEW UPLOAD_5XSOFT
- If UPLOAD.FORM("operation")="add" Then
- call Add
- elseif UPLOAD.FORM("operation")="edit" Then
- call Edit
- ELSE
- call showerr("操作无效!")
- end if
- '-----------------------------
- Dim rs
- Dim sql
- '-----------------------------
- Function Add
- set rs=server.createobject("adodb.recordset")
- rs.open "select * from news",conn,1,3
- rs.addnew
- rs("title")=UPLOAD.FORM("title")
- rs("content")=htmlencode(UPLOAD.FORM("content"))
- rs("posttime")=DATE()
- DIM FILE
- set file=upload.file("file")
- if file.FileSize>0 then
- file.saveAs Server.mappath("../../upload/"&rs("id")&getfilename(file.FileName))
- rs("pic")=rs("id")&getfilename(file.FileName)
- end if
- rs.Update
- call showmsg("信息添加成功!","list.asp")
- End Function
- '-----------------------------
- Function Edit
- set rs=server.createobject("adodb.recordset")
- rs.open "select * from news where id="&UPLOAD.FORM("id"),conn,1,3
- rs("title")=UPLOAD.FORM("title")
- rs("content")=htmlencode(UPLOAD.FORM("content"))
- rs("posttime")=DATE()
- DIM FILE
- set file=upload.file("file")
- if file.FileSize>0 then
- IF GETFILENAME(RS("pic"))<>GETFILENAME(FILE.FILENAME) THEN
- CALL DoDelFile("../../upload/"&RS("pic"))
- END IF
- file.saveAs Server.mappath("../../upload/"&rs("id")&getfilename(file.FileName))
- rs("pic")=rs("id")&getfilename(file.FileName)
- end if
- rs.Update
- call showmsg("信息修改成功!","list.asp")
- End Function
- '-----------------------------
- %>
- <%
- call COCLS
- %>