Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Warning: Cannot modify header information - headers already sent by..., nie lada zagadka
Jarod
post 24.11.2007, 20:41:53
Post #1





Grupa: Zarejestrowani
Postów: 1 190
Pomógł: 27
Dołączył: 23.04.2005

Ostrzeżenie: (0%)
-----


Piszę tego posta w tym dziale, bo sam nie wiem w czym problem - na pewno nie w php. Korzystam z apache 2.0.58 i php 5.2.0.

Mam dosyć dużą aplikację, która została tak zaprojektowana, że wszystkie headery wysyłam na samym początku, zbudowana o wzorzec MVC. Jakiś czas temu potrzebowałem kalendarz w JS i znalazłem pod adresem: http://www.kubiczek.biz/uploaded/datetimepicker.zip

Po dodaniu dwóch linijek aplikacj sypie błędami (...)headers already sent(...) Szczerze - nie wiem w czym problem..

Przy poniższym kodzie brak problemów
  1. <link rel="stylesheet" href="Css/main.css" type="text/css" />
  2. <!--[if gte IE 6]><link rel="stylesheet" href="Css/main_ie.css" type="text/css" /><![endif]-->
  3. <script type="text/javascript" src="Js/PopUp.js"></script>


Przy poniższym kodzie występuję błąd jak w tytule posta
  1. <link rel="stylesheet" href="Css/main.css" type="text/css" />
  2. <!--[if gte IE 6]><link rel="stylesheet" href="Css/main_ie.css" type="text/css" /><![endif]-->
  3. <script type="text/javascript" src="Js/PopUp.js"></script>
  4. <link rel="stylesheet" href="Css/DateTimePicker.css" type="text/css" />
  5. <script type="text/javascript" src="Js/DateTimePicker.js"></script>



Przy poniższym kodzie brak problemów
  1. <link rel="stylesheet" href="Css/main.css" type="text/css" />
  2. <script type="text/javascript" src="Js/PopUp.js"></script>
  3. <link rel="stylesheet" href="Css/DateTimePicker.css" type="text/css" />
  4. <script type="text/javascript" src="Js/DateTimePicker.js"></script>


Proszę o pomoc


EDIT:


Przeprowadziłem małe testy.. Wyniki są dla mnie zaskakujące - nie potrafię ich racjonalnie wytłumaczyć..

Brak błędu headers...
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
  3. <?php echo '<base href="http://' . $_SERVER['HTTP_HOST'] . Config::$SystemPath . '" />'; ?>
  4. <link rel="stylesheet" href="Css/main.css" type="text/css" />
  5. <link rel="stylesheet" href="Css/main1.css" type="text/css" />
  6. <link rel="stylesheet" href="Css/main2.css" type="text/css" />
  7. <link rel="stylesheet" href="Css/main3.css" type="text/css" />
  8. <link rel="stylesheet" href="Css/main4.css" type="text/css" />
  9. <link rel="stylesheet" href="Css/main5.css" type="text/css" />
  10. <link rel="stylesheet" href="Css/main6.css" type="text/css" />
  11. <link rel="stylesheet" href="Css/main7.css" type="text/css" />
  12. <link rel="stylesheet" href="Css/main8.css" type="text/css" />
  13. <link rel="stylesheet" href="Css/main9.css" type="text/css" />
  14.  
  15. <title>TransBag</title>
  16. </head>


Błąd headers already sent...
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
  3. <?php echo '<base href="http://' . $_SERVER['HTTP_HOST'] . Config::$SystemPath . '" />'; ?>
  4. <link rel="stylesheet" href="Css/main.css" type="text/css" />
  5. <link rel="stylesheet" href="Css/main1.css" type="text/css" />
  6. <link rel="stylesheet" href="Css/main2.css" type="text/css" />
  7. <link rel="stylesheet" href="Css/main3.css" type="text/css" />
  8. <link rel="stylesheet" href="Css/main4.css" type="text/css" />
  9. <link rel="stylesheet" href="Css/main5.css" type="text/css" />
  10. <link rel="stylesheet" href="Css/main6.css" type="text/css" />
  11. <link rel="stylesheet" href="Css/main7.css" type="text/css" />
  12. <link rel="stylesheet" href="Css/main8.css" type="text/css" />
  13. <link rel="stylesheet" href="Css/main9.css" type="text/css" />
  14. <link rel="stylesheet" href="Css/main10.css" type="text/css" />
  15.  
  16. <title>TransBag</title>
  17. </head>


Czy jest ograniczona ilość znaczników meta/itp, którą można zamieścić w sekcji head ?

Ten post edytował nospor 4.12.2007, 10:26:05


--------------------
”Godzina nauki w życiu nowoczesnego apostoła jest godziną modlitwy.”
(św. Josemaría Escrivá, Droga, 335)
Go to the top of the page
+Quote Post

Posty w temacie
- Jarod   [php] Warning: Cannot modify header information - headers already sent by...   24.11.2007, 20:41:53
- - webdicepl   Błąd wyskakuje bo wysyłasz coś do przeglądarki (pr...   24.11.2007, 22:22:26
|- - Jarod   Cytat(webdicepl @ 24.11.2007, 22:22:2...   24.11.2007, 22:28:09
- - webdicepl   Z treści błędu jasno wynika że coś wcześniej zosta...   24.11.2007, 22:41:24
|- - Jarod   Cytat(webdicepl @ 24.11.2007, 22:41:2...   24.11.2007, 22:51:09
- - my salsa   to musi byc wina wysylanych naglowkow przez PHP, n...   25.11.2007, 01:52:33
|- - Jarod   Cytat(my salsa @ 25.11.2007, 01:52:33...   25.11.2007, 02:01:50
- - my salsa   nie pokazujesz nam chyba calego kodu, cos tam musi...   25.11.2007, 03:11:02
|- - Jarod   Cytat(my salsa @ 25.11.2007, 03:11:02...   25.11.2007, 12:06:06
- - webdicepl   Daj zipa z wszystkim tak żeby można było to łatwo ...   25.11.2007, 12:23:59
- - SirZooro   W tym ostatnim przykładzie wywołujesz funkcję head...   25.11.2007, 13:05:49
- - Jarod   @webdicepl: Nie mogę - kod nie jest darmowy. Przet...   25.11.2007, 17:12:45
- - kevinsz   Myślę, że bez podania choćby kawałka kodu nikt Ci ...   25.11.2007, 19:20:20
- - Jarod   Wiecie co? Oglądałem przed chwilką film 1408. Czyt...   25.11.2007, 21:11:39
- - phpion.com   Hmmm mnie od razu przenosi na google, nic nie musz...   25.11.2007, 21:16:45
- - Jarod   Mam włączone wyświetlanie wszystkich błędów + E_ST...   25.11.2007, 21:49:34
- - seiya   No jaja jak berety   26.11.2007, 23:14:10
- - my salsa   ostatnio mialem podobny problem, robiac kodowanie ...   30.11.2007, 13:00:47
- - Jarod   Korzystam z eclipse no ale sprawdzę..   30.11.2007, 13:44:44
- - miska   [HTML] pobierz, plaintext <link rel="style...   4.12.2007, 10:11:32
- - nospor   @miska te spacje nie maja tu nic do gadania. Jako ...   4.12.2007, 10:22:14
- - Jarod   @nospor: Wprowadziłem ostatnio drobne zmiany w kon...   4.12.2007, 12:40:49


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 15.08.2025 - 00:33