shiSet.asp
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:2k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

DOS

  1. <!--#include file="conn.asp"-->
  2. <%if session("admin")="" then
  3. response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.asp';</script>"
  4. response.End
  5. end if
  6. dim id,shengid,shiid,shiorder,shiname,shino,i
  7. id=request("id")
  8. if request("action")="update" then
  9.     for i=1 to request.form("shiid").count
  10. shiid=replace(request.form("shiid")(i),"'","")
  11. shengid=replace(request.form("shengid")(i),"'","")
  12. shiorder=replace(request.form("shiorder")(i),"'","")
  13. shiname=replace(request.form("shiname")(i),"'","")
  14. shino=replace(request.form("shino")(i),"'","")
  15. if replace(request.form("shiorder")(i),"'","")="" then
  16. %>
  17. <script language=javascript>
  18. history.back()
  19. alert("请填写市的显示排序!")
  20. </script>
  21. <%
  22. Response.End
  23. end if
  24. conn.execute("update city set shengid="&shengid&",shiorder="&shiorder&",shiname='"&shiname&"',shino='"&shino&"' where id="&shiid)
  25.     next
  26. conn.close
  27. set conn=nothing
  28. response.write "<script language=javascript>alert('市设置成功!');window.location.href='shimanage.asp';</script>"
  29. end if
  30. if request("action")="add" then
  31. shengid=request.form("shengid")
  32. shino=request.form("shino")
  33. shiname=trim(request("shiname"))
  34. shiorder=request.form("shiorder")
  35. If shiname="" Then
  36. response.write "市名称不能为空!请<a href=javascript:history.go(-1)>返回重新填写</a>!"
  37. response.end
  38. end if
  39. If shino="" Then
  40. response.write "市编号名称不能为空!请<a href=javascript:history.go(-1)>返回重新填写</a>!"
  41. response.end
  42. end if
  43. If shiorder="" Then
  44. response.write "排序不能为空!请<a href=javascript:history.go(-1)>返回重新填写</a>!"
  45. response.end
  46. end if
  47. Set rs = Server.CreateObject("ADODB.Recordset")
  48. rs.open "select * from city",conn,1,3
  49. rs.addnew
  50. rs("shiname")=shiname
  51. rs("shengid")=shengid
  52. rs("shino")=shino
  53. rs("shiorder")=shiorder
  54. rs.update
  55. rs.close
  56. set rs=nothing
  57. conn.close
  58. set conn=nothing
  59. response.write "<script language=javascript>alert('市添加成功!');window.location.href='shimanage.asp';</script>"
  60. end if
  61. %>