Oye excelente aporte goncafa, aca lo publico entonces completo para el que necesite hacer validacion de login y password (contraseña) con php:
Cita: Esta es la pagina login.html:
<html>
<body bgcolor="#FFFFFF" text="#000000">
<div id="wb_Table1" style="position:absolute; left:362px; top:201px; width:281px; height:123px; z-index:1" align="left">
<form name="form1" method="post" action="ordendepedido.jsp">
<table width="106%" border="1" cellpadding="0" cellspacing="1" id="Table1">
<tr>
<td height="36" colspan="2" align="left" valign="top" class="blackshade2"><div align="center">CONECTAR</div></td>
</tr>
<tr>
<td height="45" align="left" valign="top"><p><br>
Documento de usuario:</p>
</td>
<td height="45" ><input name="Docu_clie" type="text" id="Docu_clie"></td>
</tr>
<tr>
<td width="160" height="45" align="left" valign="top"><p align="left"><br>
Contraseña:</p>
</td>
<td width="129" height="45" >
<label>
<input name="cont_clie" type="password" class="main_table_border2" id="cont_clie">
<br>
</label> </td>
</tr>
<tr>
<td height="27" colspan="2" align="left" valign="top"><div align="center"><span>
<input class=button type=submit value="Entrar" name="OK">
</span></div></td>
</tr>
</table> </form>
</div>
</body>
</html>
Este es el ordendepedido.jsp
Cita: <%@ page import="java.io.*, java.util.*, java.net.*, java.sql.*" %>
<%! int clave=0; %>
<%
Connection conn = null;
Statement stmt_consul=null, stmt_inser = null;
Object dato;
String strcon = "jdbc:mysql://localhost/cotizacion?user=root&password=", q=null;
//conexion a la base de datos
try {
Class.forName("com.mysql.jdbc.Driver").newInstance ();
conn=DriverManager.getConnection(strcon);
stmt_inser = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITI VE,
ResultSet.CONCUR_UPDATABLE);
} catch(java.lang.ClassNotFoundException e){} catch(SQLException e) {};
ResultSet rs3= null;
String Docu_clie = request.getParameter("Docu_clie");
if(request.getParameter("OK") != null){
String cont_clie = request.getParameter("cont_clie");
try {
rs3 = stmt_inser.executeQuery("select * from cliente where Docu_clie='" + Docu_clie + "' and Cont_clie = '" + cont_clie + "'");
if(!rs3.next())
{
out.println("<h1>Usuario no registrado</h1><META HTTP-EQUIV=REFRESH CONTENT=1;URL=login.jsp>");
return;
}
do {
out.println("<b>Bienvenido "+rs3.getString("Nomb_clie"));
out.println(rs3.getString("apel_clie")+"</b>");
}
while(rs3.next());
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
%>
Saludos!!!
Nelson Contreras