add_operate.jsp
资源名称:zyp.rar [点击查看]
上传用户:zdly666
上传日期:2022-08-09
资源大小:6511k
文件大小:1k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
JavaScript
- <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
- <%@page import="java.util.Date"%>
- <%@page import="java.util.*"%>
- <%@page import="java.text.*"%>
- <%@ include file="conn.jsp" %>
- <%
- String name=new String(request.getParameter("name").getBytes("iso-8859-1"));
- String qq = new String(request.getParameter("qq").getBytes("iso-8859-1"));
- String email = new String(request.getParameter("email").getBytes("iso-8859-1"));
- String http = new String(request.getParameter("http").getBytes("iso-8859-1"));
- String content = new String(request.getParameter("content").getBytes("iso-8859-1"));
- String ip = new String(request.getRemoteAddr().getBytes("iso-8859-1"));
- String sex=new String(request.getParameter("sex").getBytes("iso-8859-1"));
- Date currTime = new Date();
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
- String ftime=new String(formatter.format(currTime).getBytes("iso-8859-1"));
- String condition="insert into users (name,content,qq,email,http,time,ip,sex) values('"+name+"','"+content+"','"+qq+"','"+email+"','"+http+"','"+ftime+"','"+ip+"','"+sex+"')";
- stmt.executeUpdate(condition);
- stmt.close();
- conn.close();
- response.sendRedirect("add_all_slly.jsp");
- %>