<%@ page import="java.text.*"%> <%@ page import="java.util.*"%> <%@ page import="java.io.*"%> <% String mode = request.getParameter("mode")==null?"Display":request.getParameter("mode").trim(); // Collect Form Stuff String fname = request.getParameter("fname")==null?"":request.getParameter("fname").trim(); String sname = request.getParameter("sname")==null?"":request.getParameter("sname").trim(); String email = request.getParameter("email")==null?"":request.getParameter("email").trim(); if(mode.equals("Validate")){ int at=email.indexOf("@",1); int dot=0; String chr=""; if (at>0) dot=email.indexOf(".",at+2); if (dot>0) chr=email.substring(dot+1,email.length()); if(fname.equals("") || fname.equals("Please Enter First Name!")){ mode = "Display"; fname = "Please Enter First Name!"; } else if(sname.equals("") || sname.equals("Please Enter Surname/Family Name!")){ mode = "Display"; sname = "Please Enter Surname/Family Name!"; } else if (email.equals("")||at<1||dot==-1||chr.equals("") || email.equals("Please enter a valid e-mail address!")){ mode = "Display"; email = "Please enter a valid e-mail address!"; }else{ mode = "Store"; } } if(mode.equals("Store")){ FileWriter fw = new FileWriter("/home/sites/exodus/requests2/emailnews.csv", true); String linePr = "\"\",\""+fname+"\",\""+sname+"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\""+email+"\",\"WX\",\"EY\"\n"; fw.write(linePr); fw.close(); mode = "Close"; } %> Exodus Email Newsletter Subscription form <% if (mode.equals("Display")){%> <%} if (mode.equals("Close")){%> <%}%>
Please enter your name and e-mail address to subscribe to the Exodus e-Newsletter, which will inform you of the latest news from Exodus, concerning new destinations, extra departures, special trips and departures, competitions and much more!
First Name
Surname/Family Name
Email

YOUR PRIVACY

AT EXODUS WE BELIEVE YOUR PRIVACY IS IMPORTANT

Exodus are committed to protecting your privacy, the information you supply here will not be passed on to third parties other than those absolutely necessary to facilitate the sending of our e-Newsletters. If you sign up to our e-Newsletter, you will receive the e-Newsletter from Exodus at approximately monthly intervals and will have the opportunity to unsubscribe with each e-Newsletter.
Thank you for subscribing to the Exodus e-Newsletter.

Be sure to add exodus@exodus.chtah.com to your
e-mail address book to ensure delivery of the eNewsletter.