Ver Mensaje Individual
  #9 (permalink)  
Antiguo 19/05/2014, 05:22
Avatar de Italico76
Italico76
 
Fecha de Ingreso: abril-2007
Mensajes: 3.303
Antigüedad: 17 años
Puntos: 292
Respuesta: no se me abre la ventana

Debido a que no chequeas con isset() ni nada parecido (is_empty, etc) si $_REQUEST['json'] tiene valor... un error se genera... se imprime...y ROMPE CABECERAS DE REDIRECCION!!!


Código PHP:
Ver original
  1. <?php
  2.     //error_reporting(-1);
  3.  
  4.     $json_array=$_REQUEST['json'];
  5.     if (isset($_REQUEST['json']))
  6.         file_put_contents('C:/wamp/www/pepito.json', $json_array);
  7.  
  8. ?>
  9. <html>
  10. <body>
  11. <script type="text/javascript">
  12. window.location.href = "http://www.cristalab.com";
  13. </script>
  14. </body>
  15. </html>

Otra opcion seria... ob_start() al comienzo o sea evitar que PHP imprima errores, poner un @ delante de $json_array=$_REQUEST['json']; ... etc pero enmascarar el error me parece mala idea
__________________
Salu2!