Ver Mensaje Individual
  #10 (permalink)  
Antiguo 23/12/2012, 14:06
XD2XD2
 
Fecha de Ingreso: diciembre-2012
Mensajes: 223
Antigüedad: 11 años, 4 meses
Puntos: 2
Respuesta: Cannot modify header information - headers already sent by

Este es mi codigo:
Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title></title>
  6. </head>
  7. // Diseño
  8. <?php
  9. if(isset($_POST['enviar'])){
  10. setcookie("es","lang");
  11. echo "XD";
  12. }else{
  13. echo '<form action="" method="post">
  14.  <input name="enviar" type="submit">
  15. </form>';
  16. }
  17. ?>
  18. // Sigo con el Diseño
  19. <body>
  20. </body>
  21. </html>

Lo podria poner hacin para que no me diese error

Código PHP:
Ver original
  1. <?php
  2. if(isset($_POST['enviar'])){
  3. setcookie("es","lang");
  4. echo "XD";
  5. }else{
  6. echo '<form action="" method="post">
  7.  <input name="enviar" type="submit">
  8. </form>';
  9. }
  10. ?>
  11. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  12. <html xmlns="http://www.w3.org/1999/xhtml">
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  15. <title></title>
  16. </head>
  17. // Diseño
  18. // Sigo con el Diseño
  19. <body>
  20. </body>
  21. </html>

Pero entonces el texto "XD" no estaria dentro del diseño estaria fuera ¿Como lo ago?
De la primera forma me sale el error Cannot modify header information - headers already sent by
Y de la segunda forma el texto "XD" no estaria en el diseño si no arriba del todo de la web.