-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddfeedback.jsp
More file actions
40 lines (34 loc) · 1.4 KB
/
addfeedback.jsp
File metadata and controls
40 lines (34 loc) · 1.4 KB
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 import="java.io.*,java.util.*,java.sql.*"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<html>
<head>
<title>INSERT Operation</title>
</head>
<body>
<c:if test="${ empty param.fname or empty param.lname}">
<c:redirect url="contactus.jsp" >
<c:param name="errMsg" value="Please Enter Valid Details" />
</c:redirect>
</c:if>
<sql:setDataSource var="dbsource" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1/login"
user="root" password=""/>
<sql:update dataSource="${dbsource}" var="result">
INSERT INTO feedback(fname,lname,email,phone,message) VALUES (?,?,?,?,?);
<sql:param value="${param.fname}" />
<sql:param value="${param.lname}" />
<sql:param value="${param.email}" />
<sql:param value="${param.phone}" />
<sql:param value="${param.message}" />
</sql:update>
<c:if test="${result>=1}">
<font size="5" color='green'> Congratulations ! Send
successfully.</font>
<c:redirect url="contactus.jsp" >
<c:param name="susMsg" value="Congratulations ! Feedback Submitted
successfully." />
</c:redirect>
</c:if>
</body>
</html>