Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [inne][MySQL][PHP]Problem z session_start
Forum PHP.pl > Forum > Przedszkole
s4fun
a wiec mam taki problem

wywala mi taki blad w stronie :

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

a oto moj config

  1. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  2. <?php
  3. define("url", "localhost");
  4. define("gamenaam", "a");
  5. define("slogan", "a");
  6. define("noreply_mail", "a@a.pl");
  7. define("contact_mail", "a@a.pl");
  8. define("database_server", "localhost");
  9. define("database_user", "root");
  10. define("database_pass", "");
  11. define("database_name", "gra");
  12.  
  13.  
  14.  
  15. mysql_connect(database_server, database_user, database_pass) or die(mysql_error());
  16. mysql_select_db(database_name) or die(mysql_error());
  17.  
  18. //Arrays
  19. $ranks = array("ranga1", "ranga2", "ranga3");
  20. $steden = array("miasto1", "miasto2");
  21. $familieranks = array("Lider", "ViceLider", "Gracz");
  22.  
  23. if(empty($ajax)) {
  24. include("includes/inc.functions.php");
  25. include("includes/inc.required_queries.php");
  26. }
  27.  
  28. if(isset($_SESSION['id'])) {
  29. $own = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE id = '" . $_SESSION['id'] . "'"));
  30. if(time() - strtotime($own['online']) >= 900) {
  31. unset($_SESSION['id']);
  32. }
  33. if($own['vip'] <= 0) {
  34. usleep(600000);
  35. }
  36. if(empty($ajax)) {
  37. mysql_query("UPDATE users SET online = '" . get_global_date("Y-m-d H:i:s") . "', ip = '" . $_SERVER['REMOTE_ADDR'] . "' WHERE id = '" . $own['id'] . "'");
  38. mysql_query("UPDATE users SET rankvordering = rankvordering - '100', rank = rank + '1' WHERE rank < '9' AND rankvordering >= '100'");
  39. }
  40. }
  41.  
  42. if(empty($ajax)) {
  43. mysql_query("UPDATE users SET rankvordering = rankvordering - '100', rank = rank + '1' WHERE rank < '" . (count($ranks) - 1) . "' AND rankvordering >= '100'");
  44. }
  45. ?>


prosze o pomoc skrypt dziala tylko, ze w tle widac ten blad
mortus
Funkcja session_start() musi być wywołana jeszcze przed wysłaniem nagłówków do przeglądarki, a Ty zdaje się wysyłasz wcześniej nagłówki. Spróbuj ją wywołać na samym początku w pliku config.php.
zend
Wywal to "<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />" i usuń spacje przed znakiem <?php
s4fun
dziekuje juz dziala
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.