Ver Mensaje Individual
  #6 (permalink)  
Antiguo 27/09/2012, 09:14
KAKOROSAS
 
Fecha de Ingreso: enero-2004
Mensajes: 72
Antigüedad: 20 años, 4 meses
Puntos: 1
Respuesta: Desabilitar el boton mediante consutulta a bd

con mis pocos conocimiento .. estoy haciendo lo siguiente

pero no me funciona.. porfa ayuda!!!



Código PHP:
<!DOCTYPE html>
<html>
    <head>
          <meta charset="utf-8" />
        <title>tab</title>
        <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0" />
        <link rel="stylesheet" href="css/style.css"/>
        <link href="-s" rel="stylesheet" type="text/css" />
      
         <script type="text/JavaScript">
var procedenciaValida = new Array(

"log_user.php"
);


var ok = false;
for(i in procedenciaValida) {

if(document.referrer.indexOf(procedenciaValida[i]) > -1) {

ok = true; 
}
}
if(!ok) {
document.location.href="log_user.php"; 
}
</script>
<body >
<?php 
    session_start
(); 
    include(
'conexion.php'); 
?>

<?php 
$rut 
$_POST["rut"]; 
echo 
"Tu rut: $rut<p>"
?> 

<?php 
$rut 
$_POST["rut"];  
if(
'function verificar_testm ($rut) = 1')
   echo 
'<button name="miboton" value="HACER" disabled>';
else
  echo 
'<button name="miboton" value="HACER">'
?>

<?php 
    
function verificar_testm($rut)
    {
        
$sql "SELECT * FROM testm WHERE rut = '$rut'";
        
$rec mysql_query($sql);
        
$count 0;
        while(
$row mysql_fetch_object($rec))
        {
            
$count++;
            
$result $row;
        }
        if(
$count == 1)
        {
            return 
1;
        }
        else
        {
            return 
0;
        }
    }
        
?>
</span>
</body>
</html>