Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Problem z session
tV2
post
Post #1





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 23.08.2006

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


Witam,
mam taki skrypt:

admin.php
  1. <?
  2. include "inc/functions.php";
  3. include "inc/config.php";
  4.  
  5. start_db($dbh, $dbl, $dbp, $db);
  6.  
  7. if ($_GET['a'] == "out")
  8. {
  9. unset($_SESSION['auth']);
  10. }
  11.  
  12. if (! isset( $_SESSION['auth'] ))
  13. {
  14. header("Location: index.php");
  15. }
  16.  
  17. echo '<a href="admin.php?a=out">Wyloguj sie</a><a href="admin.php?a=addt"> Dodaj druzyne</a><a href="admin.php?a=adds"> Dodaj wynik</a><br /><br />';
  18.  
  19. if ($_GET['a'] == "addt")
  20. {
  21. echo '<form action="admin.php" method="post">
  22. <b>Nazwa druzyny: </b><input type="text" name="team" maxlength="30" /><br />
  23.  </b><input type="submit" value="dodaje" />
  24. </form>';
  25. }
  26. ?>


functions.php
  1. <?
  2. function start_db($host, $user, $pass, $db)
  3. {
  4. @mysql_connect($host, $user, $pass) or die("Nie mozna polaczyc sie z baza.");
  5. @mysql_select_db($db) or die("Nie mozna polaczyc sie z baza.");
  6. return(TRUE);
  7. }
  8. ?>


Podczas wykonywa "admin.php?a=out" dostaje:

Kod
Warning: Cannot modify header information - headers already sent by (output started at /var/www/virtual/tv2.avh.pl/htdocs/tl/inc/functions.php:8) in /var/www/virtual/tv2.avh.pl/htdocs/tl/admin.php on line 16


Co moze byc przyczyna?

Pozdrawiam

EDIT:

Oh, problem rozwiazalem przy pomocy buforu, temat do zamkniecia smile.gif

Ten post edytował tV2 26.08.2006, 00:36:28
Go to the top of the page
+Quote Post

Posty w temacie
- tV2   [php] Problem z session   26.08.2006, 00:07:58


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: 19.08.2025 - 05:45