Photo_save.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:2k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../FS_Inc/Const.asp" -->
  3. <!--#include file="../FS_Inc/Function.asp" -->
  4. <!--#include file="../FS_InterFace/MF_Function.asp" -->
  5. <!--#include file="lib/strlib.asp" -->
  6. <!--#include file="lib/UserCheck.asp" -->
  7. <%
  8. dim rs,str_tmppic,i_s,str_tmppicarr,p_FolderObj,p_FSO,p_FileObj
  9. Set p_FSO = Server.CreateObject(G_FS_FSO)
  10. if Request.Form("Action")="add" then
  11. str_tmppic=Replace(Request.Form("pic_1")&"|"&Request.Form("pic_2")&"|"&Request.Form("pic_3")," ","")
  12. str_tmppicarr =split(str_tmppic,"|")
  13. for i_s=0 to Ubound(str_tmppicarr)
  14. if str_tmppicarr(i_s)<>"" then
  15. p_FolderObj = p_FSO.GetFile(Server.MapPath(Replace(str_tmppicarr(i_s),"/",""))).size
  16. set rs= Server.CreateObject(G_FS_RS)
  17. rs.open "select * From FS_ME_Photo where 1=0",User_conn,1,3
  18. rs.addnew
  19. rs("title")=Request.Form("title")
  20. rs("PicSavePath")=str_tmppicarr(i_s)
  21. rs("Content")=NoHtmlHackInput(Request.Form("Content"))
  22. rs("Addtime")=now
  23. if Request.Form("ClassID")<>"" then
  24. rs("ClassID")=clng(Request.Form("ClassID"))
  25. else
  26. rs("ClassID")=0
  27. end if
  28. rs("PicSize")=p_FolderObj
  29. rs("Hits")=0
  30. rs("UserNumber")=Fs_User.UserNumber
  31. rs.update
  32. rs.close:set rs=nothing
  33. end if
  34. next
  35. strShowErr="<li>保存相册成功</li>"
  36. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=../PhotoManage.asp")
  37. Response.end
  38. elseif Request.Form("Action")="edit" then
  39. p_FolderObj = p_FSO.GetFile(Server.MapPath(Replace(Request.Form("pic_1"),"/",""))).size
  40. set rs= Server.CreateObject(G_FS_RS)
  41. rs.open "select * From FS_ME_Photo where id="&Clng(Request.Form("id")),User_conn,1,3
  42. rs("title")=Request.Form("title")
  43. rs("PicSavePath")=Request.Form("pic_1")
  44. rs("Content")=NoHtmlHackInput(Request.Form("Content"))
  45. if Request.Form("ClassID")<>"" then
  46. rs("ClassID")=clng(Request.Form("ClassID"))
  47. else
  48. rs("ClassID")=0
  49. end if
  50. rs("PicSize")=p_FolderObj
  51. rs.update
  52. rs.close:set rs=nothing
  53. strShowErr="<li>修改成功</li>"
  54. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=../PhotoManage.asp")
  55. Response.end
  56. end if
  57. set p_FSO=nothing
  58. set Fs_User=nothing
  59. %><!--Powsered by Foosun Inc.,Product:FoosunCMS V4.0系列-->