%@ include file="globalPaths.jsp" %>
<%@ include file="globalDefinitions.jsp" %>
<%
String errorDescription = null;
String query = "";
boolean scam = false;
if (request.getParameter("submit")!=null)
{
if (getParameter("name") == null || getParameter("name").equals(""))
{
sendRedirect(globalErrorPage+"?"+"errorDescription=" + URLencode("Please specify name"));
return;
}
if (getParameter("email")==null || !checkEmail(getParameter("email")) || getParameter("email").equals(""))
{
sendRedirect(globalErrorPage+"?"+"errorDescription=" + URLencode("Please specify correct email"));
return;
}
if (getParameter("subject") == null || getParameter("subject").equals(""))
{
sendRedirect(globalErrorPage+"?"+"errorDescription=" + URLencode("Please specify subject"));
return;
}
if (getParameter("comments") == null || getParameter("comments").equals(""))
{
sendRedirect(globalErrorPage+"?"+"errorDescription=" + URLencode("Please specify comments"));
return;
}
String comments = getParameter("comments");
try
{
if (isSpam(comments, false, false))
{
scam = true;
}
if (!"true".equals(request.getParameter("jscheck")))
{
scam = true;
}
Long sessionCheck = (Long)session.getAttribute("contact.sessioncheck");
session.removeAttribute("contact.sessioncheck");
if (sessionCheck == null || (sessionCheck.longValue() % 1998 != 0))
{
scam = true;
}
if (scam)
{
throw new UserInputException("There was a problem submitting your message. Unknown Error");
}
}
catch(UserInputException e)
{
if (!scam)
errorLog(e);
errorDescription = e.getMessage() + ".";
sendRedirect(globalErrorPage + "?errorDescription="
+ URLEncoder.encode(errorDescription) + "&log=0");
return;
}
catch(Exception e)
{
errorLog(e, query);
sendRedirect(globalErrorPage + "?errorDescription="
+ URLEncoder.encode(e.getMessage() + "."));
return;
}
plainContent = comments;
if (getParameter("logged")!=null)
{
plainContent += "\n\nArtist Info:\nid: "
+ getParameter("loggedartist")+"\nName: "
+ getParameter("loggedartistname")+"\nPackage: "
+ packageToString(getParameter("loggedartistpack"));
}
plainContent += "\n\nPlatform: " + request.getParameter("platform")
+ "\nBrowser: " + request.getParameter("browser")+"\n";
if (!send(htmlContent, plainContent,companyName,contactUsEmail,getParameter("subject"),getParameter("name"),getParameter("email")))
{
// Error will be logged inside send function
}
plainContent="Your inquiry has been submitted to " +
"MesArt. Please allow for some" + " time for us to answer. Thank you!";
if (!send(htmlContent, plainContent,getParameter("name"),getParameter("email"),"Your inquiry has been submitted to MesArt.",companyName,contactUsEmail))
{
// Error will be logged inside send function
}
sendRedirect("sent2.shtml");
return;
}
else
{
session.setAttribute("contact.sessioncheck",
new Long(Math.round(Math.random() * 1000.0) * 1998));
}
%>
Contact Us!
<%@ include file="inc/head.txt" %>
<%@ include file="inc/top.txt" %>
<%@ include file="inc/bottom.txt" %>
<%@ include file="globalFinally.jsp" %>