Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/07/2007, 04:33
nikotina
 
Fecha de Ingreso: abril-2007
Mensajes: 73
Antigüedad: 17 años, 1 mes
Puntos: 1
No ejecuta consulta

Hola amigos. Tengo un problema que me desconcierta. Tengo un form en donde toma el usuario y password. los datos se mandan a un codigo"chek_usuario" que muestro a continuacion, y resulta que no ejecuta la consulta. he chequeado las variables $var1 y $var2 y las toma correctamente. tambien he chequeado la BBDD y esta todo ok. Si alguien me pude ayudar lo agradecere, pues yo no veo error en el codigo.

Código HTML:
<html>
<head>
<title>chekeo de usuarios</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor=#F79E00>
<?php
include('conexion.php');
$con=conexion();
$var1=$_POST['user'];
$var2=$_POST['clave']; 
$cons="select * from usuarios where usuario='$var1' and pass='$var2'";
$x=mysql_query($cons);
if(mysql_num_rows($x))
{header("location:marcos.htm");}

else{echo"<br><br><br><pre>                                         <img src=usuario.gif border=1 width=120 height=160 align=center></pre><br>";
	echo "<pre>                                      <font size=+1> <b>ACCESO DENEGADO!</b></font></pre><pre>                             CONSULTE AL ADMINISTRADOR DEL SISTEMA</font></pre>";}

?>
</body>
</html>