Ver Mensaje Individual
  #11 (permalink)  
Antiguo 14/05/2009, 08:44
manoloOZ
 
Fecha de Ingreso: octubre-2008
Mensajes: 151
Antigüedad: 15 años, 7 meses
Puntos: 1
Respuesta: PHP con JavaScript

Cita:
Iniciado por David el Grande Ver Mensaje
header() no puedes usar después de haber enviado una salida al navegador. El metatag debe estar en el head, y debes especificarle algunos segundos de retardo, de lo contrario va a redireccionar antes de que puedas ver el contenido.
la funcion la puse en el head y con tiempo 1 pero sigue isn andar, el codigo esta asi:

Código PHP:
<?
ob_start
();
?>

<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
<? 
$id 
$_GET["id"];
//
?>
<script>
 
      function checkSubmit() {

          document.getElementById("btsubmit").value = "Enviando...";

          document.getElementById("btsubmit").disabled = true;
            
        window.open('comprobante.php?id=<?php echo $id?>', 'windowname1', 'width=400, height=400');
        
        <meta HTTP-EQUIV="Refresh" CONTENT="0;URL=actualiza_pagos.php?id="<?php echo $id?>"&efectivo="<?php echo $_POST["efectivo"]; ?>>;
          return true;
  
      }
//estas son funciones para ver o no algunos div
    function mostrar_cheques()
    {
        var cheque = document.getElementById("cheque").value;
        
        if(cheque == '')
        {
        
        document.getElementById("banco_cheque").style.visibility = 'hidden';
            document.getElementById("bancoemisor").style.visibility = 'hidden';
        document.getElementById("num_ch").style.visibility = 'hidden';
        document.getElementById("numero").style.visibility = 'hidden';
        }else
        {
        document.getElementById("banco_cheque").style.visibility = '';
        document.getElementById("bancoemisor").style.visibility = '';
        document.getElementById("numero").style.visibility = '';
        document.getElementById("num_ch").style.visibility = '';
        }
    }
    function mostrar_tarjeta()
    {
        var tarjeta = document.getElementById("tarjeta").value;
        
        if(tarjeta == '')
        {
        
        document.getElementById("divtarjeta").style.visibility = 'hidden';
        document.getElementById("cuotas").style.visibility = 'hidden';
        
        }else
        {
        document.getElementById("divtarjeta").style.visibility = '';
        document.getElementById("cuotas").style.visibility = '';
        }
    }


</script>
</head>
el problema puede ser que mezcle el php con meta tag?