-
Notifications
You must be signed in to change notification settings - Fork 1
/
commentwrite_ok.jsp
40 lines (33 loc) · 1.07 KB
/
commentwrite_ok.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.Date" %>
<html>
<head>
<title>게시판</title>
</head>
<body>
<%@ include file="top.jsp" %>
<%@ include file="dbconfig.jsp" %>
<%
Statement stmt = null;
String ww = request.getParameter("writer"); //write.jsp에서 name에 입력한 데이터값
String cc = request.getParameter("content"); //write.jsp에서 memo에 입력한 데이터값
int iiidx = Integer.parseInt(request.getParameter("boardNo"));
int max = 0;
stmt = myConn.createStatement();
String sql = "INSERT INTO commenttable(comment_id, comment_content, comment_ref) VALUES(?,?,?)";
PreparedStatement pstmt = myConn.prepareStatement(sql);
pstmt.setString(1, ww);
pstmt.setString(2, cc);
pstmt.setInt(3, iiidx);
pstmt.execute();
pstmt.close();
stmt.close();
myConn.close();
%>
<script language=javascript>
self.window.alert("입력한 댓글을 저장하였습니다.");
location.href = "view.jsp?idx=<%=iiidx%>";
</script>
</body>
</html>