![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 29 Pomógł: 0 Dołączył: 5.10.2006 Ostrzeżenie: (0%) ![]() ![]() |
Witam,
mam taki oto problem: Próbuje wysłać cookies za pomocą funkcji setcookie, ale oczywiście wyskoczyć musi błąd ;] oto kod w php jaki napisałem:
i teraz pojawia mi się taki oto błąd: Kod Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /index.php:1) in /index.php on line 4 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /index.php:1) in /index.php on line 4 Warning: Cannot modify header information - headers already sent by (output started at /index.php:1) in /index.php on line 9 z tego co zrozumiałem to php nie może wysłać cookies bo są już wysłane nagłówki... tylko najdziwniejsze jest to, że nic nie wysyłam przed cookies'em (no chyba, że się mylę), mógłby ktoś pomóc? Ten post edytował zakaru 25.07.2008, 08:57:16 |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 234 Pomógł: 5 Dołączył: 26.01.2008 Skąd: Lutcza Ostrzeżenie: (20%) ![]() ![]() |
Kod session_start(); Musi się znajdowac zaraz po <?php KOD: Kod <?php session_start(); session_save_path("sesje/"); ob_start(); if(!isset($_COOKIE['USTAWIENIA'])){ $ustawienia="cos tam cos tam"; setcookie("USTAWIENIA", $ustawienia, time()+120960000000, "/"); $_COOKIE['USTAWIENIA']=$ustawienia; } ?> Pozdro (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) Ten post edytował Zmorcia 25.07.2008, 10:12:13 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 3.10.2025 - 16:46 |