Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> problem z utf-8, "Cannot modify header information ..."
wojto
post
Post #1





Grupa: Zarejestrowani
Postów: 158
Pomógł: 0
Dołączył: 29.06.2003
Skąd: Warszawa

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


Witam,
Mam problem z ustawieniem kodowania plikow na utf-8.
Zawartosc plikow wyglada nastepujaco:

index.php
  1. <?php
  2. require_once('header.php');
  3. ?>
  4.  
  5. próba znaków<br />
  6. ąćęłńóśżź<br />
  7. ĄĆŁŃÓŚŻŹ


header.php
  1. <?php
  2. if (basename(__FILE__) == basename($_SERVER['PHP_SELF'])) {
  3. exit('Nie możesz otworzyć tego pliku bezpośrednio !');
  4. }
  5.  
  6. require_once('config.php');
  7. ?>
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  9. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
  10. <head>
  11. <meta http-equiv="Content-Language" content="pl" />
  12. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  13. <title>tytuł</title>
  14. </head>
  15.  
  16. <body>


config.php
  1. <?php
  2.  
  3. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  4. header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
  5. header("Cache-Control: no-store, no-cache, must-revalidate");
  6. header("Cache-Control: private, pre-check=0, post-check=0, max-age=0", false);
  7. header("Pragma: no-cache");
  8.  
  9. if (basename(__FILE__) == basename($_SERVER['PHP_SELF'])) {
  10. exit('Nie możesz otworzyć tego pliku bezpośrednio !');
  11. }
  12. ?>


jak widac ustawione jest kodowanie na utf-8, pliki takze sa zakodowane programem w utf-8

po uruchomieniu wyswietla poprawnie polskie znaki, jednak wyswietla tez jakies bledy:
Kod
Warning: Cannot modify header information - headers already sent by (output started at c:\usr\apache\httpd\html\tmp\index.php:1) in c:\usr\apache\httpd\html\tmp\config.php on line 4

Warning: Cannot modify header information - headers already sent by (output started at c:\usr\apache\httpd\html\tmp\index.php:1) in c:\usr\apache\httpd\html\tmp\config.php on line 5

Warning: Cannot modify header information - headers already sent by (output started at c:\usr\apache\httpd\html\tmp\index.php:1) in c:\usr\apache\httpd\html\tmp\config.php on line 6

Warning: Cannot modify header information - headers already sent by (output started at c:\usr\apache\httpd\html\tmp\index.php:1) in c:\usr\apache\httpd\html\tmp\config.php on line 7

Warning: Cannot modify header information - headers already sent by (output started at c:\usr\apache\httpd\html\tmp\index.php:1) in c:\usr\apache\httpd\html\tmp\config.php on line 8
próba znaków
ąćęłńóśżź
ĄĆŁŃÓŚŻŹ


co nalezy zmienic, aby tego nie bylo?

pozdrawiam i dziekuje za odpowiedzi


--------------------
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 21.08.2025 - 03:04