Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php][mysql] problem z zapytaniem
-[php]-
post
Post #1





Goście







Proszę o pomoc bo juz nie wiem gdzie jest błąd, dane post'em dobrze przenosi i są takie jak w bazie a mimo to nie loguje mi sie na stronie - gdzie jest błąd?

  1. <?php
  2. function odbierz($pole) {
  3. $pole = trim($pole);
  4. if (get_magic_quotes_gpc()) $pole = stripslashes($pole);
  5. return htmlspecialchars($pole, ENT_QUOTES);
  6. }
  7. $user = odbierz($_POST['user']);
  8. $password = odbierz($_POST['password']);
  9.  
  10. if (($user=='') AND ($password=='')) {
  11. header("Location: ../bledy/puste_pole.html");
  12. } else {
  13. include("../tabele/user.php");
  14. include("../zapytania/mysql_connect.php");
  15.  
  16. $password = md5($password);
  17. $zapytanie= mysql_query ("SELECT * FROM $mysql_tabela WHERE user='$user' and password='$password'") or 
  18. die ("Błąd w zapytaniu");
  19.  
  20. $wiersz = mysql_fetch_array( $zapytanie );
  21. $ile = $wiersz[0];
  22.  
  23. if ( $ile > 0 ) {
  24. $_SESSION['LOGGED'] = "TRUE";
  25. $_SESSION['user']=$wiersz['user'];
  26. $_SESSION['imie']=$wiersz['imie'];
  27. $_SESSION['nazwisko']=$wiersz['nazwisko'];
  28. $_SESSION['status']=$wiersz['status'];
  29. header("Location: ../user/index.html");
  30. } else {
  31. header("Location: ../bledy/login_haslo.html");
  32. }
  33. }
  34. ?>
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: 24.08.2025 - 01:28