Ver Mensaje Individual
  #8 (permalink)  
Antiguo 16/12/2008, 16:59
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 9 meses
Puntos: 2135
Respuesta: PHP funcion header

Creo esto lo deja claro jeje:
Cita:
It is important to note that headers are actually sent when the first byte is output to the browser. If you are replacing headers in your scripts, this means that the placement of echo/print statements and output buffers may actually impact which headers are sent. In the case of redirects, if you forget to terminate your script after sending the header, adding a buffer or sending a character may change which page your users are sent to.
En otras palabras si envias un header() con el location, luego algo ya sea un echo "y"; empieza la redireccion y las siguientes lineas son ignoradas.

Si no hay datos enviados entonces si, llamadas subsecuentes reemplazan la anterior.

Caso de ejemplo:
Código php:
Ver original
  1. <?php
  2. header("location: 1.html");
  3. header("location: 2.html"); //reemplaza 1.html

Otro:
Código php:
Ver original
  1. <?php
  2. header("location: 1.html");
  3. echo "y";
  4. header("location: 2.html");

En el segundo caso se iria a 1.html y no marcara error.

Saludos