Naddsave.asp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <%Session.CodePage=65001%>
  2. <!--#include file="../bdcommx/connxyz.asp"-->
  3. <%
  4. Function chgenter(str)
  5. t1=""
  6. for i=1 to len(str)
  7. h=mid(str,i,1)
  8. if asc(h)=10 then h="<br>"
  9. if asc(h)=13 then h=""
  10. t1=t1+h
  11. next
  12. str=t1
  13. chgenter=str
  14. End Function
  15. %>
  16. <%
  17. call log_chk()
  18. dim title,picpath,Bid,Sid,Bname,Sname,tj,d_content,note,tlink,odr
  19. title=trim(request("title"))
  20. picpath=request("picpath")
  21. Bid=request("Bid")
  22. Sid=request("Sid")
  23. Bname=request("Bname")
  24. Sname=request("Sname")
  25. tlink=request("tlink")
  26. note=request("note")
  27. dt=request("select_date")
  28. dianji=request("dianji")
  29. tj=request("tj")
  30. odr=request("odr")
  31. d_content=request("d_content")
  32. if title="" then
  33. call backurl("标题不能为空!")
  34. else
  35. Set rs=Server.Createobject("Adodb.Recordset")
  36. sql="select * from bdnews order by nws_id desc"
  37. rs.open sql,conn,1,3
  38. rs.addnew
  39. rs("nws_title")=title
  40. rs("Fileurl")=picpath
  41. rs("nb_id")=Bid
  42. if Sid<>"" then
  43. rs("ns_id")=Sid
  44. end if
  45. if tj<>"" then
  46. rs("nws_tj")=tj
  47. end if
  48. if odr<>"" then
  49. rs("nws_order")=odr
  50. end if
  51. rs("nws_cont")=d_content
  52. rs("nws_note")=chgenter(note)
  53. rs("nws_click")=dianji
  54. rs("nws_link")=tlink
  55. rs("nws_Author")=session("adminxxx")
  56. if dt<>"" then
  57. rs("nws_time")=dt
  58. else
  59. rs("nws_time")=now()
  60. end if
  61. rs.update
  62. rs.close
  63. set rs=nothing
  64. call GoUrl("Nadd.asp?Bid="&Bid&"&Sid="&Sid&"&Bname="&Bname&"&Sname="&Sname&"","添加成功")
  65. end if
  66. %>