home *** CD-ROM | disk | FTP | other *** search
/ 221.214.14.186 / 221.214.14.186.tar / 221.214.14.186 / zb / Notepad-1 / editsave.asp < prev    next >
Text File  |  2004-12-09  |  2KB  |  73 lines

  1. <!--#include file="conn.asp"-->
  2. <%
  3. if instr(request.servervariables("http_referer"),"edit")<1 then
  4.     response.redirect "index.asp"
  5. end if
  6.  
  7. if instr(request.servervariables("http_referer"),"http://"&request.servervariables("host") )<1 then
  8.     response.redirect "index.asp"
  9. end if
  10.  
  11. dim title,email,qq,url,nei,id,rt
  12. dim exec, rs
  13.      
  14. id=encodestr(Request.form("id"))
  15. title=encodestr(Request.form("title"))
  16. email=encodestr(Request.form("email"))
  17. qq=encodestr(Request.form("qq"))
  18. url=encodestr(Request.form("url"))
  19. nei=replace(Request.form("nei"),"'","""")
  20.  
  21.  
  22. if id="" or not theUser.reged then
  23.     session("errmsg")="╖╟╖¿▓┘╫≈úíúíúí"
  24.     response.redirect("admin_error.asp")
  25. end if
  26.  
  27. if len(title)>40 then
  28.     title=left(title,40)
  29. end if
  30.  
  31. Set rs = Server.CreateObject("ADODB.Recordset")
  32. exec="select * from ly where id="&id
  33. rs.Open exec,conn,1,2
  34. if rs.eof then
  35.     rsclose()
  36.     connclose()
  37.     session("errmsg")="╕├┴⌠╤╘▓╗┤µ╘┌úíúíúí"
  38.     response.redirect "admin_error.asp"
  39. end if
  40. rs("title")=title
  41. if email="" then
  42.     rs("email")=null
  43. else
  44.     rs("email")=email
  45. end if
  46. if qq="" then
  47.     rs("qq")=null
  48. else
  49.     rs("qq")=qq
  50. end if
  51. if url="" then
  52.     rs("url")=null
  53. else
  54.     rs("url")=url
  55. end if
  56. if instr(nei,"[align=right][ ┤╦┴⌠╤╘▒╗ "&theUser.name&" ╨▐╕─╣² ][/align]")>0 then
  57.     rs("nei")=nei
  58. else
  59.     rs("nei")=nei&"[align=right][ ┤╦┴⌠╤╘▒╗ "&theUser.name&" ╨▐╕─╣² ][/align]"
  60. end if
  61. rs.update
  62. rs.requery
  63. rt=rs("rt")
  64. rsclose()
  65. connclose()
  66.  
  67. if rt=0 then
  68.     session("url")="show.asp?id="&id
  69. else
  70.     session("url")="show.asp?id="&rt&"#"&id
  71. end if
  72. response.redirect "addok.asp"    
  73. %>