Hola:
Tengo mas o menos el siguiente codigo en PHP:
//Este file se llama: TEST.PHP
<html>
<head>
<title>HOLA</title>
</head>
<body>
switch( $_GET["modulo"] )
{
case 'opcion'
//hace algo y luego
header( "Location: TEST.PHP" );
break;
default:
//formulario
break;
}
</body>
</html>
Y me da el siguiente error:
Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\jorge\fotos\loader_files.php:4)
Porque en WINDOWS no puedo usar esa funcion header() ???.... Como puedo hacer que funcione dicha funcion ??, ya que el codigo es mucho mas amplio y necesito tener la funcion dentro del SWITCH, que a su vez, este SWITCH esta dentro de <body>.
Ayuda porfavor!!!
bye bye
no se trata de eso se trata de que ya enviaste una cabecera al browser despues de eso ya no puedes enviar mas headers por que te lanza un error , primero ejecuta el php y despues recien envia al navegador las etiquetas html
Saludos.
<?php
switch( $_GET["modulo"] )
{
case 'opcion'
//hace algo y luego
header( "Location: TEST.PHP" );
break;
default:
//formulario
break;
}
?>
<html>
<head>
<title>HOLA</title>
</head>
<body>
<!--FORMULARIO-->
</body>
</html>