bbs2/comment_insert.jsp
페이지 정보
본문
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/include/header.jsp" %>
<%
request.setCharacterEncoding("utf-8");
String code = request.getParameter("code");
String uid = request.getParameter("uid");
String field = request.getParameter("field");
String search = request.getParameter("search");
String page_now = request.getParameter("page_now");
String view_comment = request.getParameter("view_comment");
//오늘 날짜
java.util.Date today = new java.util.Date();
SimpleDateFormat cal = new SimpleDateFormat("yyyy-MM-dd");
String signdate = cal.format(today);
//입력
String sql = "INSERT INTO comment (tb_table, tb_uid, tb_id, tb_name, tb_comment, tb_date)";
sql += " VALUES ('"+code+"',"+uid+",'"+session_id+"','"+session_name+"','"+view_comment+"','"+signdate+"')";
Connection conn=DriverManager.getConnection(url, user, password);
Statement stmt=conn.createStatement();
stmt.executeUpdate(sql);
stmt.close();
conn.close();
%>
<script type="text/javascript">
location.href="view.jsp?code=<%=code%>&uid=<%=uid%>&field=<%=field%>&search=<%=search%>&page_now=<%=page_now%>";
</script>
- 이전글bbs2/delete.jsp 23.03.16
- 다음글bbs2/comment_delete.jsp 23.03.16
댓글목록
등록된 댓글이 없습니다.