| |
|
| |
| Home | Forum | Post New Message |
| Post New Message |
|
<%
fb.setURL(URL);fb.setUSERNAME(USERNAME);fb.setPASSWORD(PASSWORD);
String btn1="",email="",qn="",sub="",username="",pwd="",btn="";
boolean flag=false;
username = (request.getParameter("txtun")==null)?"":request.getParameter("txtun").trim();
pwd = (request.getParameter("txtpw")==null)?"":request.getParameter("txtpw").trim();
btn=(request.getParameter("login")==null)?"N":request.getParameter("login");
btn1 = (request.getParameter("btnpost")==null)?"N":request.getParameter("btnpost");
sub= (request.getParameter("txtsub")==null)?"":request.getParameter("txtsub");
qn = (request.getParameter("txtqn")==null)?"":request.getParameter("txtqn");
Vector loginResult=null;
if(!btn.equals("N"))
{
loginResult=lb.loginSteering(username,pwd,usrSession);
if(!loginResult.isEmpty())
{
Hashtable h1 = (Hashtable)loginResult.get(0);
usrName=(String)h1.get("usr_Name");
Pwd=(String)h1.get("pass_Word");
uName=(String)h1.get("user_Name");
Stat=(String)h1.get("user_Status");
uEmail=(String)h1.get("user_Email");
session.putValue("userName", usrName);
session.putValue("Pwd", Pwd);
session.putValue("Stat", Stat);
session.putValue("uName", uName);
session.putValue("uEmail", uEmail);
lb.setIncorrect_pwd("");
}
else
{
loginResult=lb.loginResources(username,pwd,usrSession);
if(!loginResult.isEmpty())
{
Hashtable h1 = (Hashtable)loginResult.get(0);
usrName=(String)h1.get("usr_Name");
Pwd=(String)h1.get("pass_Word");
uName=(String)h1.get("user_Name");
Stat=(String)h1.get("user_Status");
uEmail=(String)h1.get("user_Email");
session.putValue("userName", usrName);
session.putValue("Pwd", Pwd);
session.putValue("Stat", Stat);
session.putValue("uName", uName);
session.putValue("uEmail", uEmail);
lb.setIncorrect_pwd("");
}
else
{
Stat="g";
uName="Guest";
lb.setIncorrect_pwd("Invalid Username or Password");
}
}
response.sendRedirect("forum_b.jsp");
return;
}
if(!btn1.equals("N"))
{
flag=fb.InsertQn(uName,uEmail,sub,qn);
if(flag)
{
try {
// Acquire our JavaMail session object
PrintWriter writer = response.getWriter();
//int intqn=Integer.parseInt(fb.getQnid());
//intqn+=1;
response.setContentType("text/html");
String content="Sir/Madam, A query has been posted in the NaMPET Discussion Forum. As a subject expert in our core competencies list, query has been forwarded to you. If you desire, a reply may be posted. If a valid reply has been already posted, you may ignore the query or an alternate reply may be posted.
\t\t\t\t View Query
If you experience any problem accessing the \"View Query\" link, please copy paste the following link to your browser\'s address location. http://www.nampet.org/Nampet/forum_view_mail.jsp?hqnid="+fb.getQnid()+"
Thanks and Regards, NaMPET Programme";
Properties mailProperties;
mailProperties=new Properties();
mailProperties.put("mail.transport.protocol","smtp");
mailProperties.put("mail.smtp.host",smtphost);
Session session1=Session.getDefaultInstance(mailProperties,null);
// Prepare our mail message
Message message = new MimeMessage(session1);
message.setFrom(new InternetAddress(fromemail));
message.setSubject(subject);
message.setContent(content, "text/html");
for (int i=0;iMessage successfully sent!");
response.sendRedirect("http://www.nampet.org/Nampet/forum_a.jsp");
return;
} catch (Throwable t) {System.out.println("EXP: forum_b.jsp " + t);}
}
else
{
response.sendRedirect("http://www.nampet.org/Nampet/forum_post_err.jsp");
return;
}
}
if(usrName.equals("")){%>
|
<% } %>
| |
|
|
| |
<% if(usrName.equals("")){%>
Only registered members can post new messages. If you are a member already, please log-in to continue. If you are not a member please use our Online Registration Form to complete the registration process.
|
<%}else{%>
<% } %>
|
|
| |
|
| |
|
|
|
|
|
|
|
|