Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [inne][MySQL][PHP]Problem z session_start
s4fun
post 28.03.2010, 22:27:31
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 27.03.2010

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


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
Go to the top of the page
+Quote Post
mortus
post 28.03.2010, 22:45:25
Post #2





Grupa: Zarejestrowani
Postów: 2 178
Pomógł: 596
Dołączył: 25.09.2009
Skąd: Piwniczna-Zdrój

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


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.
Go to the top of the page
+Quote Post
zend
post 28.03.2010, 22:48:35
Post #3





Grupa: Zarejestrowani
Postów: 580
Pomógł: 85
Dołączył: 25.03.2010
Skąd: Skrzyszów :)

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


Wywal to "<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />" i usuń spacje przed znakiem <?php
Go to the top of the page
+Quote Post
s4fun
post 28.03.2010, 23:05:43
Post #4





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 27.03.2010

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


dziekuje juz dziala
Go to the top of the page
+Quote Post

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 Wersja Lo-Fi Aktualny czas: 13.06.2025 - 08:42