Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> php logowanie
czarkowy
post
Post #1





Grupa: Zarejestrowani
Postów: 31
Pomógł: 1
Dołączył: 6.08.2017
Skąd: sdsadada

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


Siemka,
zrobiłem logowanie w php i jest mały problem, otóż za każdym raze jest niepoprawne logowanie, nie ważne czy dobry login i hasło czy zły

index.php
  1. <!DOCTYPE html>
  2. <html lang="pl">
  3. <meta charset="UTF-8">
  4. <title>Home Page</title>
  5. <link rel="stylesheet" href="index.css">
  6. <link rel="stylesheet" href="register.css">
  7. </head>
  8.  
  9. <form class="form-contener" action="signin.php" mathod="POST">
  10. <input type="text" class="inputText" name="username" placeholder="Your username">
  11. <input type="password" class="inputText" name="pass" placeholder="Your password">
  12. <button type="submit" class="inputSubmit" name="login">Sign In</button>
  13. </form>
  14.  
  15. </body>
  16. </html>


signin.php
  1. <?php
  2.  
  3. include 'db_connect.php';
  4.  
  5. $username = isset($_POST['username']) ? $_POST['username'] : "";
  6. $pass = isset($_POST['pass']) ? $_POST['pass'] : "";
  7.  
  8. $sql = "SELECT * FROM users WHERE username = '$username' AND pass = '$pass'";
  9.  
  10. $result = mysqli_query($conn, $sql);
  11.  
  12. if(!$row = mysqli_fetch_assoc($result)) {
  13. echo "Niezalogowany";
  14. } else {
  15. echo "Zalogowany";
  16. }


o co moze chodzic? :_:
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 20.08.2025 - 10:04