Ver Mensaje Individual
  #6 (permalink)  
Antiguo 15/09/2008, 09:12
Avatar de ferbux
ferbux
 
Fecha de Ingreso: mayo-2007
Ubicación: por ahí intentado ayudar
Mensajes: 823
Antigüedad: 16 años, 11 meses
Puntos: 6
Respuesta: llamar funcion desde boton formulario

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!!!
__________________
"Eres grande por que caminas entre gigantes"