<?php
   session_start();
   if(isset($_POST['txtoculto'])){
      $musuario = $_POST['txtusuario'];
      $mpass = $_POST['txtpass'];
   
      $mCon = mysql_connect("localhost","egocar1_conecto","123456A*");
      $mBD  = mysql_select_db("egocar1_datos");
   
      $mConsul = "SELECT * FROM usuarios WHERE nombre='$musuario' and sign='$mpass'";
      $mRs = mysql_query($mConsul);
      $mensaje="";
      if(mysql_num_rows($mRs)>0){
         $mRow = mysql_fetch_array($mRs);
         $_SESSION['permitir']="1";
	 header('Location:/Registro/Consultar.php');
      }else{
	 $mensaje= "El nombre de usuario o contraseņa no existen";
	 
      }
   }
?>

<html>
   <head>
      <title>:: Control de Acceso ::</title>
      <style type="text/css">
<!--
.Estilo1 {
	font-size: 24px;
	color: #0000FF;
}
-->
      </style>
</head>
   
   <body>
      <p align="center" class="Estilo1">Control de Acceso </p>
      <form name="frmAcceso" action="Acceso.php" method="post">
      <table align="center" border="0">
         <tr>
            <th>Usuario</th>
	    <th align="left"><input  type="text" name="txtusuario" alt="Nombre del Usuario" maxlength="20"/></th>
	    </tr>
	 <tr>
	    <th>Contraseņa</th>
	    <th align="left"><input  type="password" name="txtpass" alt="Password del Usuario" maxlength="20" /></th>
         </tr>
	 <tr><th></th>
	    <th align="left"><input type="submit" name="txtaceptar" value="Aceptar" />
	       <input type="hidden" name="txtoculto" value="0" />
	    </th>
	    <tr><th></th><th align="center">
	       <?php echo "<span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; color: #DF0101; font-weight: bold;'>$mensaje</span>";?></th>
	    </tr>
         </tr>
	 
      </table>
      </form>
   </body>
</html>
