这是我的代码
<%@ page import="java.sql.*" %>
<%
String t1,t2,t3;
Connection con;
Statement stmt;
ResultSet rs;
%>
<%
t1=request.getParameter("utype");
t2=request.getParameter("uid");
t3=request.getParameter("pwd");
out.println("->" + t1);
try
{
rs=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:uiddsn");
stmt=con.createStatement();
if(t1.equals("Admin"))
{
rs=stmt.executeQuery("select uid,pwd from admin where uid='" + t2 + "' and pwd='" + t3 + "'");
if (rs.next()){
session.setAttribute("ut",t1);
session.setAttribute("logid",t2);
response.sendRedirect("aoptions.htm");
}
}
else
out.println("<font color=red><b>Invalid Login....<a href='left.htm'>Try Again</a>");
if(t1.equals("Aadhaar Staff"))
{
rs=stmt.executeQuery("select sid,pwd from astaff where sid=" + t2 + " and pwd='" + t3 + "'");
if (rs.next()){
session.setAttribute("ut",t1);
response.sendRedirect("soptions.htm");
}
else
out.println("<font color=red><b>Invalid Login....<a href='left.htm'>Try Again</a>");
}
if(t1.equals("Crime"))
{
rs=stmt.executeQuery("select sid,pwd from pinmast where sid='" + t2 + "' and pwd='" + t3 + "' and stype='ps' ");
if (rs.next())
{
session.setAttribute("ut",t1);
session.setAttribute("logid",t2);
response.sendRedirect("croptions.htm");
}
else
out.println("<font color=red><b>Invalid Login....<a href='left.htm'>Try Again</a>");
}
if(t1.equals("Citizen"))
{
rs=stmt.executeQuery("select ano,apwd from cregn where ano=" + t2 + " and apwd='" + t3 + "'");
if (rs.next())
{
session.setAttribute("ut",t1);
session.setAttribute("logid",t2);
response.sendRedirect("czoptions.htm");
}
else
out.println("<font color=red><b>Invalid Login....<a href='left.htm'>Try Again</a>");
}
if(t1.equals("AAI"))
{
rs=stmt.executeQuery("select aaid,aapwd from aai where aaid='" + t2 + "' and aapwd='" + t3 + "'");
if (rs.next())
{
session.setAttribute("ut",t1);
session.setAttribute("logid",t2);
response.sendRedirect("aaioptions.htm");
}
else
out.println("<font color=red><b>Invalid Login....<a href='left.htm'>Try Again</a>");
}
if(t1.equals("RTA"))
{
rs=stmt.executeQuery("select sid,pwd from pinmast where sid='" + t2 + "' and pwd='" + t3 + "'");
if (rs.next())
{
session.setAttribute("ut",t1);
session.setAttribute("logid",t2);
response.sendRedirect("rtaoptions.htm");
}
else
out.println("<font color=red><b>Invalid Login....<a href='left.htm'>Try Again</a>");
}
}
catch(Exception ee)
{
out.println(ee.getMessage());
}
%>
不知道问题出在哪里。我是jsp和所有编程人员的新手。我曾尝试过百万个网站,但没有针对此问题找到任何适当的解决方案。我正在使用XAMPP控制面板使用Java 7,Tomcat服务器。请帮我修复它。我真的很需要 不知道是什么问题。我是jsp和所有编程人员的新手。我曾尝试过百万个网站,但没有针对此问题找到任何适当的解决方案。我正在使用XAMPP控制面板使用Java 7,Tomcat服务器。请帮我修复它。我真的很需要它...