Prueba hacer algo como esto:
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<body>
<FORM method="POST" ACTION="prueba.php">
Nombre: <input type="text" name="nom" value="<? echo $nom;?>">
Password:<input type="text" name="pass" value="<? echo $pass;?>">
<input type="submit" name="entrar" value="ENTRAR">
</FORM>
</body>
</html>
<?
include('../../tu archivo de conexion.php');
$nom=$_POST["nom"];
$pass=$_POST["pass"];
$sel="SELECT nombre FROM users WHERE pass=$pass AND nombre=\"$nom\"";
$result=mysql_query($sel) or die('Consulta fallida: ' . mysql_error());
$row=mysql_fetch_array($result);
if(!$row){
//haces tu insert
}
else{
echo "<script languaje=javascript>".
"alert(\"El usuario no esta registrado, registrese primero \");".
"location.href=\"Registro.php\";".
"</script>";
header("location: ?");
}
?>
Saludos!!!