Tengo esta página.......
<BODY BGCOLOR="#dddddd" TEXT="#000000">
<script>
function validar () {
if (form_entrada.ht_usuario.value.length <= 0 || form_entrada.ht_pass.value.length <= 0)
{
alert("Debe introducir Usuario/Password");
return(false);
}
else
{
<?php
/* Conexion, seleccion de base de datos */
$db_conn = ocilogon( "trpago", "thales123" );
/**** pasamos la variable HTML a variable php ****/
$query = "SELECT COD_CLIENTE
FROM TRP_USUARIOS
WHERE COD_USUARIO = '$ht_usuario'
AND PASSWORD = '$ht_pass'";
$parsed = ociparse($db_conn, $query);
ociexecute($parsed, OCI_DEFAULT);
$nrows = ocifetchstatement($parsed, $results);
while ( $column = each($results) ) {
$data = $column['value'];
}
OCILogoff($db_conn);
if (strlen($data[0]) == 0)
{
?>
alert ("Usuario/Password incorrecto"); return(false);
<?php
}
else
{
?>
alert ("ok"); return(true);
<?php
}
?>
}
}
</script>
</head>
<body>
<form action="General.html" method="POST" name = "form_entrada" onSubmit="return validar()">
<BR> <BR> <BR> <BR> <BR>
<PRE><b><FONT SIZE=5> USUARIO: </b></font> <input type="text" name="ht_usuario" MAXLENGTH = "8" size="8" /></PRE>
<PRE><b><FONT SIZE=5> PASSWORD:</b></font> <input type="password" name="ht_pass" MAXLENGTH = "8" size="8"/></PRE>
<PRE>
<input type="submit" value="Aceptar" >
</PRE>
</form>
</BODY>
Las variables ht_usuario y ht_pass no son reconocidas en php, siempre se me va por "Usuario/Password incorrecto".
Qué puedo hacer para que me recoja los valores que se introducen en el formulario??????
Gracias!!
