Ver Mensaje Individual
  #7 (permalink)  
Antiguo 08/06/2007, 08:01
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años, 8 meses
Puntos: 2135
Re: No me funciona la condicion if

HMSJUAN:

No es posible pasar una variable de javascript asi de esa forma, lo mas cercano es mandandolo via GET asi:
Código PHP:
<html> 
 <body>
  <script type="text/javascript">    
    function eliminar_cliente(idCliente){
       var url = "<?php echo $_SERVER['PHP_SELF']; ?>";
       if (confirm("¿SEGURO QUE DESEA ELIMINAR ESTE CLIENTE?")) {
           window.location = url + "?idCliente=" + idCliente + "&confirma=1";
       } else {
           window.location = url + "?idCliente=" + idCliente + "&confirma=0";
       }
    }
   </script>
<?php 
 $resultado 
$_GET['confirma'];
 if (
$resultado == "1")
 {    
    echo 
'<script type="text/javascript">alert("VERDADERO");</script>';
    echo 
'\CLIENTE INSERTADO';
 }
 else
 {
    echo 
'<script type="text/javascript">alert("FALSO");</script>';
    echo 
'\CLIENTE BORRADO';
 }
?>
</body> 
</html>