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
sada
post
Post #2





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

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


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

if (isset($_POST['nick'])) {
  $loginUsername=$_POST['nick'];
  $password=$_POST['haslo'];
  $MM_fldUserAuthorization = "status";
  $MM_redirectLoginSuccess = "index.php";
  $MM_redirectLoginFailed = "logowanienieudane.php";
  $MM_redirecttoReferrer = true;
  mysql_select_db($database_aaa, $aaa);
      
  $LoginRS__query=sprintf("SELECT nick, haslo, status FROM nazwabazy WHERE nick='%s' AND haslo='%s'",
  get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
  
  $LoginRS = mysql_query($LoginRS__query, $aaa) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
    
    $loginStrGroup  = mysql_result($LoginRS,0,'status');
    
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;          

    if (isset($_SESSION['PrevUrl']) && true) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];    
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?>


z htaccessa tylko to jako tako dotyczy problemu:

RewriteCond %{HTTP_HOST} ^www.nazwastrony.pl
RewriteRule ^(.*) http://nazwastrony.pl/$1 [R=301,L]
RewriteRule ^logowanie logowanie.php [L]
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 - 18:19