Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%--
- Document : page4
- Created on : Apr 22, 2017, 1:14:28 AM
- Author : Sam
- --%>
- <%@page import="java.util.Arrays"%>
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Page 4 - Professional Conference</title>
- <%
- String[] seminar;
- String fName, lName, address, city, state, zip, pNumber, email, cName;
- String javascript = "No";
- String php = "No";
- String mysql = "No";
- String apache = "No";
- String webservices = "No";
- seminar = request.getParameterValues("seminar");
- for(int i=0; i<seminar.length; i++) {
- if(seminar[i].equals("JavaScript")) {
- javascript = "Yes";
- }
- else if(seminar[i].equals("PHP")) {
- php = "Yes";
- }
- else if(seminar[i].equals("MySQL")) {
- mysql = "Yes";
- }
- else if(seminar[i].equals("Apache")) {
- apache = "Yes";
- }
- else if(seminar[i].equals("Web Services")) {
- webservices = "Yes";
- }
- }
- //Store seminar check box into session
- if(javascript.equals("Yes"))
- session.setAttribute("javascript", "Yes");
- else
- session.setAttribute("javascript", "No");
- if(php.equals("Yes"))
- session.setAttribute("php", "Yes");
- else
- session.setAttribute("php", "No");
- if(mysql.equals("Yes"))
- session.setAttribute("mysql", "Yes");
- else
- session.setAttribute("mysql", "No");
- if(apache.equals("Yes"))
- session.setAttribute("apache", "Yes");
- else
- session.setAttribute("apache", "No");
- if(webservices.equals("Yes"))
- session.setAttribute("webservices", "Yes");
- else
- session.setAttribute("webservices", "No");
- //Get parameter from session and assign variables to be displayed
- if(((String) session.getAttribute("fName")) != null)
- fName = (String) session.getAttribute("fName");
- else
- fName = "<font color='red'>**REQUIRED**</font>";
- if(((String) session.getAttribute("lName")) != null)
- lName = (String) session.getAttribute("lName");
- else
- lName = "<font color='red'>**REQUIRED**</font>";
- if(((String) session.getAttribute("address")) != null)
- address = (String) session.getAttribute("address");
- else
- address = "<font color='red'>**REQUIRED**</font>";
- if(((String) session.getAttribute("city")) != null)
- city = (String) session.getAttribute("city");
- else
- city = "<font color='red'>**REQUIRED**</font>";
- if(((String) session.getAttribute("state")) != null)
- state = (String) session.getAttribute("state");
- else
- state = "<font color='red'>**REQUIRED**</font>";
- if(((String) session.getAttribute("zip")) != null)
- zip = (String) session.getAttribute("zip");
- else
- zip = "<font color='red'>**REQUIRED**</font>";
- if(((String) session.getAttribute("pNumber")) != null)
- pNumber = (String) session.getAttribute("pNumber");
- else
- pNumber = "<font color='red'>**REQUIRED**</font>";
- if(((String) session.getAttribute("email")) != null)
- email = (String) session.getAttribute("email");
- else
- email = "<font color='red'>**REQUIRED**</font>";
- if(((String) session.getAttribute("cName")) != null)
- cName = (String) session.getAttribute("cName");
- else
- email = "<font color='red'>**REQUIRED**</font>";
- //String
- //String
- //String
- //String
- //String
- //String
- //String cName = (String) session.getAttribute("cName");
- //String cAddress = (String) session.getAttribute("cAddress");
- //String cCity = (String) session.getAttribute("cCity");
- //String cState = (String) session.getAttribute("cState");
- //String cZip = (String) session.getAttribute("cZip");
- //String cPNumber = (String) session.getAttribute("cPNumber");
- //String cEmail = (String) session.getAttribute("cEmail");
- %>
- </head>
- <body>
- <h1>Summary</h1>
- You entered the following information.
- <br/>
- <table>
- <tr>
- <td>
- <h2>Personal Information</h2>
- First Name : <%= fName %>
- <br/>
- Last Name : <%= lName %>
- <br/>
- Address : <%= address %>
- <br/>
- City : <%= city %>
- <br/>
- State : <%= state %>
- <br/>
- Zip : <%= zip %>
- <br/>
- Phone : <%= pNumber %>
- <br/>
- E-mail : <%= email %>
- </td>
- <td>
- <h2>Company Information</h2>
- </td>
- <td>
- <a href="page3.jsp"><h2>Seminars</h2></a>
- JavaScript seminar : <%= javascript %>
- <br/>
- PHP seminar : <%= php %>
- <br/>
- MySQL seminar : <%= mysql %>
- <br/>
- Apache seminar : <%= apache %>
- <br/>
- Web Services seminar : <%= webservices %>
- </td>
- </tr>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement