1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| <html>
<head>
<title>RechercheEnseignant</title>
</head>
<%@ page import = "java.io.*, java.lang.*, java.sql.*, java.util.*" %>
<body>
<%
String id=request.getParameter("idet");
String mdp=request.getParameter("mdp");
String login;
String pwd;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
Connection con = DriverManager.getConnection("jdbc:odbc:enpebd", "", "");
java.sql.Statement stmt = con.createStatement();%>
<%ResultSet rs=stmt.executeQuery( "SELECT log,pwd FROM compte WHERE log='"+id+"';");%>
<% while (rs.next()){%>
login<%=rs.getString("log")%>;
pwd=<%=rs.getString("pwd")%>;
<%if((id.equals(login))&&(mdp.equals(pwd))) {
response.sendRedirect("identification.html");
}
else {
out.println("Vérifiez bien vos coordonnées!!!");
}
%>
<% }
}
catch(Exception e){}
%>
</table>
</body>
</html> |
Partager