Advertisement
Guest User

page4

a guest
Apr 21st, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.51 KB | None | 0 0
  1. <%--
  2. Document : page4
  3. Created on : Apr 22, 2017, 1:14:28 AM
  4. Author : Sam
  5. --%>
  6.  
  7. <%@page import="java.util.Arrays"%>
  8. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  9. <!DOCTYPE html>
  10. <html>
  11. <head>
  12. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  13. <title>Page 4 - Professional Conference</title>
  14.  
  15. <%
  16. String[] seminar;
  17. String fName, lName, address, city, state, zip, pNumber, email, cName;
  18.  
  19.  
  20. String javascript = "No";
  21. String php = "No";
  22. String mysql = "No";
  23. String apache = "No";
  24. String webservices = "No";
  25.  
  26. seminar = request.getParameterValues("seminar");
  27.  
  28. for(int i=0; i<seminar.length; i++) {
  29. if(seminar[i].equals("JavaScript")) {
  30. javascript = "Yes";
  31. }
  32. else if(seminar[i].equals("PHP")) {
  33. php = "Yes";
  34. }
  35. else if(seminar[i].equals("MySQL")) {
  36. mysql = "Yes";
  37. }
  38. else if(seminar[i].equals("Apache")) {
  39. apache = "Yes";
  40. }
  41. else if(seminar[i].equals("Web Services")) {
  42. webservices = "Yes";
  43. }
  44. }
  45.  
  46. //Store seminar check box into session
  47. if(javascript.equals("Yes"))
  48. session.setAttribute("javascript", "Yes");
  49. else
  50. session.setAttribute("javascript", "No");
  51.  
  52. if(php.equals("Yes"))
  53. session.setAttribute("php", "Yes");
  54. else
  55. session.setAttribute("php", "No");
  56.  
  57. if(mysql.equals("Yes"))
  58. session.setAttribute("mysql", "Yes");
  59. else
  60. session.setAttribute("mysql", "No");
  61.  
  62. if(apache.equals("Yes"))
  63. session.setAttribute("apache", "Yes");
  64. else
  65. session.setAttribute("apache", "No");
  66.  
  67. if(webservices.equals("Yes"))
  68. session.setAttribute("webservices", "Yes");
  69. else
  70. session.setAttribute("webservices", "No");
  71.  
  72. //Get parameter from session and assign variables to be displayed
  73. if(((String) session.getAttribute("fName")) != null)
  74. fName = (String) session.getAttribute("fName");
  75. else
  76. fName = "<font color='red'>**REQUIRED**</font>";
  77.  
  78. if(((String) session.getAttribute("lName")) != null)
  79. lName = (String) session.getAttribute("lName");
  80. else
  81. lName = "<font color='red'>**REQUIRED**</font>";
  82.  
  83. if(((String) session.getAttribute("address")) != null)
  84. address = (String) session.getAttribute("address");
  85. else
  86. address = "<font color='red'>**REQUIRED**</font>";
  87.  
  88. if(((String) session.getAttribute("city")) != null)
  89. city = (String) session.getAttribute("city");
  90. else
  91. city = "<font color='red'>**REQUIRED**</font>";
  92.  
  93. if(((String) session.getAttribute("state")) != null)
  94. state = (String) session.getAttribute("state");
  95. else
  96. state = "<font color='red'>**REQUIRED**</font>";
  97.  
  98. if(((String) session.getAttribute("zip")) != null)
  99. zip = (String) session.getAttribute("zip");
  100. else
  101. zip = "<font color='red'>**REQUIRED**</font>";
  102.  
  103. if(((String) session.getAttribute("pNumber")) != null)
  104. pNumber = (String) session.getAttribute("pNumber");
  105. else
  106. pNumber = "<font color='red'>**REQUIRED**</font>";
  107.  
  108. if(((String) session.getAttribute("email")) != null)
  109. email = (String) session.getAttribute("email");
  110. else
  111. email = "<font color='red'>**REQUIRED**</font>";
  112.  
  113. if(((String) session.getAttribute("cName")) != null)
  114. cName = (String) session.getAttribute("cName");
  115. else
  116. email = "<font color='red'>**REQUIRED**</font>";
  117. //String
  118. //String
  119. //String
  120. //String
  121. //String
  122. //String
  123. //String cName = (String) session.getAttribute("cName");
  124. //String cAddress = (String) session.getAttribute("cAddress");
  125. //String cCity = (String) session.getAttribute("cCity");
  126. //String cState = (String) session.getAttribute("cState");
  127. //String cZip = (String) session.getAttribute("cZip");
  128. //String cPNumber = (String) session.getAttribute("cPNumber");
  129. //String cEmail = (String) session.getAttribute("cEmail");
  130. %>
  131.  
  132. </head>
  133. <body>
  134. <h1>Summary</h1>
  135.  
  136. You entered the following information.
  137. <br/>
  138.  
  139. <table>
  140. <tr>
  141. <td>
  142. <h2>Personal Information</h2>
  143. First Name : <%= fName %>
  144. <br/>
  145. Last Name : <%= lName %>
  146. <br/>
  147. Address : <%= address %>
  148. <br/>
  149. City : <%= city %>
  150. <br/>
  151. State : <%= state %>
  152. <br/>
  153. Zip : <%= zip %>
  154. <br/>
  155. Phone : <%= pNumber %>
  156. <br/>
  157. E-mail : <%= email %>
  158. </td>
  159. <td>
  160. <h2>Company Information</h2>
  161. </td>
  162. <td>
  163. <a href="page3.jsp"><h2>Seminars</h2></a>
  164. JavaScript seminar : <%= javascript %>
  165. <br/>
  166. PHP seminar : <%= php %>
  167. <br/>
  168. MySQL seminar : <%= mysql %>
  169. <br/>
  170. Apache seminar : <%= apache %>
  171. <br/>
  172. Web Services seminar : <%= webservices %>
  173. </td>
  174. </tr>
  175. </table>
  176. </body>
  177. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement