pagina.php
Código HTML:
<form id="frmlogin" method="post" action="ingresar.php"> <label for="txtusuario">Cliente ID:<a href="pages/registro.php">Registrate</a></label> <input id="txtcedula" type="text" name="txtcedula" value="" / <label for="txtcontrasena">Contraseña:</label> <input id="txtclave" type="password" name="txtclave" value="" /> <input id="btningresar" type="submit" name="Login" value="Ingresar" /> </form>
Código PHP:
<?php $db_conn = mysql_connect("localhost", "usu", "clave");
mysql_select_db("db");
$query1 = "select * from usuario"
."where emp_cedula='$txtcedula' "
." and emp_clave='$txtclave'";
$result1 = mysql_query($query1);//ejecutamos la consulta
$row=mysql_fetch_array($result1);
$num=mysql_affected_rows();
if($num>=1)
{
header("location:paginaqingresolosdatos.php?var=1");
}
else
header("location:paginaerror.php");
saludos..