-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript1.jsp
More file actions
27 lines (24 loc) · 877 Bytes
/
script1.jsp
File metadata and controls
27 lines (24 loc) · 877 Bytes
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
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"%>
<%@ page import="java.util.*,java.io.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Contact Form Submission</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<%
String name = request.getParameter("name");
String email = request.getParameter("email");
String message = request.getParameter("message");
// Simple validation for form fields
if (name == null || email == null || message == null || name.isEmpty() || email.isEmpty() || message.isEmpty()) {
out.println("<h1>Error: All fields are required!</h1>");
} else {
out.println("<h1>Thank you for your message, " + name + "!</h1>");
out.println("<p>We will get back to you at " + email + " shortly.</p>");
}
%>
</body>
</html>