savelinks.jsp
上传用户:szlmxq
上传日期:2014-01-31
资源大小:740k
文件大小:1k
源码类别:

Applet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=GBK" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ include file="conn.jsp"%>
  3. <%
  4. if(session.getAttribute("admin_name")==null){
  5. ;}else{
  6. String action=request.getParameter("action");
  7. int ac=0;
  8. if(action.equals("add"))
  9. ac=1;
  10. if(action.equals("edit"))
  11. ac=2;
  12. if(action.equals("del"))
  13. ac=3;
  14. int link_id=Cint(request.getParameter("id"));
  15. int bs=Cint(request.getParameter("bs"));
  16. switch(ac){
  17. case 1:
  18. sql="Insert into ad(wordlink,url,bs) values('"+getStr(request.getParameter("wordlink"))+"','"+getStr(request.getParameter("url"))+"',"+bs+")";
  19. mdb.executeInsert(sql);
  20. response.sendRedirect("links.jsp");
  21. break;
  22. //----------------------------------------
  23. case 2:
  24. sql="update ad set wordlink='"+getStr(request.getParameter("wordlink"))+"',url='"+getStr(request.getParameter("url"))+"',bs="+bs+" where id="+link_id+"";
  25. mdb.executeUpdate(sql);
  26. response.sendRedirect("links.jsp");
  27. break;
  28. //--------------------------------
  29. case 3:
  30. sql="delete from ad where id="+link_id+"";
  31. mdb.executeDelete(sql);
  32. response.sendRedirect("links.jsp");
  33. break;
  34. }
  35. }%>