Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]problem z session_start();
AniaR
post 20.10.2009, 08:08:46
Post #1





Grupa: Zarejestrowani
Postów: 92
Pomógł: 0
Dołączył: 6.05.2009
Skąd: warszawa

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


Moj panel logowania wyglada tak:
  1. <?
  2. require_once ("DBConnection.php");
  3. if (count($_GET) > 0 && isset($_GET['logout'])) {
  4. $logout = $_GET['logout'];
  5. if ($logout == "t") {
  6. unset($_SESSION['username']);
  7. unset($_SESSION['password']);
  8. unset($_SESSION['role']);
  9. header("Location: login.php");
  10. }
  11. } else {
  12. $connection = new DBConnection();
  13. $connection->open();
  14. if (count($_POST) > 0 && !isset($_POST['msg']) ) {
  15. $login=$_POST['login'];
  16. $password=$_POST['password'];
  17. if ($login==null || $password==null)
  18. {
  19. header("Location: login.php?msg=emptyfield");
  20. }
  21. else {
  22. $query = "SELECT login, haslo FROM uzytkownik WHERE login = '$login' and rola = 'A'";
  23. $connection->executeQuery($query);
  24. $count = $connection->rowsCount();
  25. if ($count == 0) {
  26. header("Location: login.php?msg=error");
  27. }
  28. else {
  29. $line = $connection->fetchAssoc();
  30. $password_db = $line['haslo'];
  31. if ($password <> $password_db) {
  32. header("Location: login.php?msg=error");
  33. }
  34. else {
  35. $_SESSION['username'] = $line['login'];
  36. $_SESSION['password'] = $line['haslo'];
  37. $_SESSION['role'] = "admin";
  38. header("Location: aktualnosci.php");
  39. }
  40. }
  41. }
  42. }
  43. $connection->close();
  44. }
  45. ?>


Z dzialalo to i dziala mi na roznych serwerach.. Jednak z jednym nie chce dzialac i nie mam pojecia dlaczego?? Pokazuja sie takie błędy:


Warning: session_start() [function.session-start]: open(/tmp/sess_5cba1cc3210030e6e106f4dbc8e474c2, O_RDWR) failed: No such file or directory (2) in /clients/majka/_mjadmin/login.php on line 1

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /clients/majka/_mjadmin/login.php:1) in /clients/majka/_mjadmin/login.php on line 1

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /clients/majka/_mjadmin/login.php:1) in /clients/majka/_mjadmin/login.php on line 1

Warning: Unknown: open(/tmp/sess_5cba1cc3210030e6e106f4dbc8e474c2, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0


Czy ktos ma pomysl o co chodzi?
Go to the top of the page
+Quote Post
nospor
post 20.10.2009, 08:11:18
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




w katalogu głownym swojego ftp utwórz katalog "tmp"


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
AniaR
post 20.10.2009, 08:18:37
Post #3





Grupa: Zarejestrowani
Postów: 92
Pomógł: 0
Dołączył: 6.05.2009
Skąd: warszawa

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


Dziekuje, 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: 18.07.2025 - 02:14