Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Problem z sesją
Leniwy
post
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 14.01.2009

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


Witam,

mój kod:
  1. <?php
  2.  
  3. if (isset($_SESSION['user_id']) and isset($_SESSION['login'])){
  4. echo "Jestes zalogowany. ";
  5. echo "Twój login to: ";
  6. echo '<b>';
  7. echo $_SESSION['login'];
  8. echo '</b>';
  9. echo ("<a href=\"logout.php\" ></br><button>Wyloguj</button></a>");
  10. }
  11.  
  12. else{
  13. echo "Nie jestes zalogowany";
  14. include 'login.php';
  15. }
  16.  
  17. ?>


i wyrzuca błędy:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\_finish\index.php:1) in C:\xampp\htdocs\_finish\index.php on line 2

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\_finish\index.php:1) in C:\xampp\htdocs\_finish\index.php on line 2

Może ktoś mi wyjaśnić o co chodzi i jak to naprawić?

ps. googlowałem w tej sprawie i nie znalazłem żadnej pomocnej porady, PHPedia.pl podaje mi http://phpedia.pl/wiki/Cannot_add_header_i...rs_already_sent co nie jest moim błędem
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:14