Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Błąd na stronie
lkj
post
Post #1





Grupa: Zarejestrowani
Postów: 69
Pomógł: 0
Dołączył: 16.08.2008

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


Hejka,

Gdy się loguje na portal to mam taki błąd:

Kod
Warning: Cannot modify header information - headers already sent by (output started at /home/jarek/ftp/portal/index.php:8) in /home/jarek/ftp/portal/logowanie.php on line 87

Warning: Cannot modify header information - headers already sent by (output started at /home/jarek/ftp/portal/index.php:8) in /home/jarek/ftp/portal/logowanie.php on line 88

Warning: Cannot modify header information - headers already sent by (output started at /home/jarek/ftp/portal/index.php:8) in /home/jarek/ftp/portal/logowanie.php on line 89

Warning: Cannot modify header information - headers already sent by (output started at /home/jarek/ftp/portal/index.php:8) in /home/jarek/ftp/portal/logowanie.php on line 90

Warning: Cannot modify header information - headers already sent by (output started at /home/jarek/ftp/portal/index.php:8) in /home/jarek/ftp/portal/logowanie.php on line 91

Warning: Cannot modify header information - headers already sent by (output started at /home/jarek/ftp/portal/index.php:8) in /home/jarek/ftp/portal/logowanie.php on line 92
Zalogowano!


Kod z pliku logowanie PHP linie: od 65 - 97:

  1. else
  2. {
  3.  
  4. $logowanie = mysql_fetch_array($zapytanie);
  5.  
  6. if($_POST['automat'] == 1) { $czas_zalogowania = time()+604800;}
  7. else { $czas_zalogowania = time()+1800;}
  8.  
  9. setcookie("user_id", $logowanie['id'], time()+1800);
  10. setcookie("login", $logowanie['login'], time()+1800);
  11. setcookie("pass", $logowanie['pass'], time()+1800);
  12.  
  13. $sql_ostrzezenia = mysql_query("SELECT * FROM `mostrzezenia` WHERE `user_id` = '".$logowanie['user_id']."'");
  14. $ile_ostrzezen = mysql_num_rows($sql_ostrzezenia);
  15.  
  16. if($ile_ostrzezen < $ile_max_ostrzezen) {
  17. setcookie("ranga", $logowanie['dostep'], $czas_zalogowania);
  18. }
  19. elseif($ile_ostrzezen >= $ile_max_ostrzezen) {
  20. setcookie("ranga", "0", $czas_zalogowania);
  21. }
  22.  
  23. setcookie("pref-pokaz_avatar", $logowanie['pokaz_avatar'], $czas_zalogowania);
  24. setcookie("pref-pokaz_calenewsy", $logowanie['pokaz_cale_newsy'], $czas_zalogowania);
  25. setcookie("pref-ile_news", $logowanie['ile_news'], $czas_zalogowania);
  26. setcookie("pref-ile_tyt", $logowanie['ile_tyt'], $czas_zalogowania);
  27. setcookie("pref-kom_pokaz_avatar", $logowanie['kom_pokaz_avatar'], $czas_zalogowania);
  28. setcookie("pref-kom_polozenie_avatar", $logowanie['kom_polozenie_avatar'], $czas_zalogowania);
  29.  
  30. echo "<b>Zalogowano!</b><br /><br /><a href='".$_SERVER['PHP_SELF']."' target='_parent'>Wejdź</a>";
  31. }
  32. }
  33. }


gdzie może leżeć problem?

Ten post edytował lkj 14.08.2009, 02:40:50
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
Fifi209
post
Post #2





Grupa: Zarejestrowani
Postów: 4 655
Pomógł: 556
Dołączył: 17.03.2009
Skąd: Katowice

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


W tym, że nagłówki muszą lecieć jako pierwsze, a Ty zapewne przed edycją cookie wysyłasz jakiś html lub coś innego.

Nawet zabezpieczenie przeciw takim tematom, na nic się tutaj nie zda jak widać...

http://phpedia.pl/wiki/Cannot_add_header_i...rs_already_sent

Ten post edytował fifi209 14.08.2009, 02:40:08
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 24.08.2025 - 10:47