add_operate.jsp
上传用户:zdly666
上传日期:2022-08-09
资源大小:6511k
文件大小:1k
源码类别:

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

开发平台:

JavaScript

  1. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
  2. <%@page import="java.util.Date"%>
  3. <%@page import="java.util.*"%>
  4. <%@page import="java.text.*"%>
  5. <%@ include file="conn.jsp" %>
  6. <%
  7. String name=new String(request.getParameter("name").getBytes("iso-8859-1"));
  8. String qq = new String(request.getParameter("qq").getBytes("iso-8859-1"));
  9. String email = new String(request.getParameter("email").getBytes("iso-8859-1"));
  10. String http = new String(request.getParameter("http").getBytes("iso-8859-1"));
  11. String content = new String(request.getParameter("content").getBytes("iso-8859-1"));
  12. String ip = new String(request.getRemoteAddr().getBytes("iso-8859-1"));
  13. String sex=new String(request.getParameter("sex").getBytes("iso-8859-1"));
  14. Date currTime = new Date();
  15. SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
  16. String ftime=new String(formatter.format(currTime).getBytes("iso-8859-1"));
  17. String condition="insert into users (name,content,qq,email,http,time,ip,sex) values('"+name+"','"+content+"','"+qq+"','"+email+"','"+http+"','"+ftime+"','"+ip+"','"+sex+"')";
  18. stmt.executeUpdate(condition);
  19. stmt.close(); 
  20. conn.close();
  21. response.sendRedirect("add_all_slly.jsp");
  22. %>