Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Jeszcze sesje, Dziwne zachowanie strony logowania
sada
post
Post #1





Grupa: Zarejestrowani
Postów: 302
Pomógł: 24
Dołączył: 6.12.2008

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


Witam!

mam problem:

strona logowania wywołana przez ścieżkę dostępu http://....... działa super bez zarzutu, a po rewrite wywala błędy jak niżej:

Warning: session_start() [function.session-start]: open(/tmp/sess_7dc51faa29feb866d2f9bf60ea1902b7, O_RDWR) failed: No such file or directory (2) in /logowanie.php on line 2

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /logowanie.php:2) in /logowanie.php on line 2

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /logowanie.php:2) in /logowanie.php on line 2

początek strony logowania wygląda tak:


Kod
<?php require_once('connections/aaa.php');if (!isset($_SESSION)){session_start();}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}


Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
marcio
post
Post #2





Grupa: Zarejestrowani
Postów: 2 291
Pomógł: 156
Dołączył: 23.09.2007
Skąd: ITALY-MILAN

Ostrzeżenie: (10%)
X----


  1. <?php
  2. require_once('connections/aaa.php');
  3. $loginFormAction = $_SERVER['PHP_SELF'];
  4. if (isset($_GET['accesscheck'])) {
  5.  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
  6. }
  7.  
  8. if (isset($_POST['nick'])) {
  9.  $loginUsername=$_POST['nick'];
  10.  $password=$_POST['haslo'];
  11.  $MM_fldUserAuthorization = "status";
  12.  $MM_redirectLoginSuccess = "index.php";
  13.  $MM_redirectLoginFailed = "logowanienieudane.php";
  14.  $MM_redirecttoReferrer = true;
  15.  mysql_select_db($database_aaa, $aaa);
  16.      
  17.  $LoginRS__query=sprintf("SELECT nick, haslo, status FROM karaoke_users5 WHERE nick='%s' AND haslo='%s'",
  18.  get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password :   addslashes($password));
  19.  
  20.  $LoginRS = mysql_query($LoginRS__query, $aaa) or die(mysql_error());
  21.  $loginFoundUser = mysql_num_rows($LoginRS);
  22.  if ($loginFoundUser) {
  23.    
  24.    $loginStrGroup  = mysql_result($LoginRS,0,'status');
  25.    
  26.    //declare two session variables and assign them
  27.    $_SESSION['MM_Username'] = $loginUsername;
  28.    $_SESSION['MM_UserGroup'] = $loginStrGroup;          
  29.  
  30.    if (isset($_SESSION['PrevUrl']) && true) {
  31.      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];    
  32.    }
  33.    header("Location: " . $MM_redirectLoginSuccess );
  34.  }
  35.  else {
  36.    header("Location: ". $MM_redirectLoginFailed );
  37.  }
  38. }
  39. ?>

Zapisz bez BOM'a u musi dzialac.

Kodu nie sprawdzalem i mozliwe ze blad jest gdzies indziej ale czasu zbytnio nie mam.

Ten post edytował marcio 9.06.2009, 16:42:00
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 26.12.2025 - 20:19