bbs3/comment_insert.jsp > JSP

본문 바로가기

사이트 내 전체검색

뒤로가기 JSP

bbs3/comment_insert.jsp

페이지 정보

작성자 관리자 작성일 23-03-16 17:20 조회 631 댓글 0

본문

<%@ 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>

추천0

댓글목록 0

등록된 댓글이 없습니다.


Copyright © dancePKT. All rights reserved.
PC 버전으로 보기