Yet another PHP based Funko Pop collection tracker, about as bare bones as you can get, but it's functional.
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

37 righe
1.2 KiB

  1. <!DOCTYPE html>
  2. <HTML>
  3. <HEAD>
  4. <link rel="stylesheet" type="text/css" href="style.css">
  5. <TITLE>Logging in</TITLE>
  6. </HEAD>
  7. <BODY>
  8. <CENTER>
  9. <?php
  10. include_once ('connect.php');
  11. $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
  12. session_start();
  13. $username = mysqli_real_escape_string($con, $_POST['username']);
  14. $password = mysqli_real_escape_string($con, $_POST['password']);
  15. $password = sha1($password);
  16. if ($con->connect_errno > 0){
  17. die ('Unable to connect to database [' . $db->connect_errno . ']');
  18. }
  19. $sqllogin = "SELECT * FROM users WHERE users.username = '$username' and passwd = '$password'";
  20. if ($result = $con->query($sqllogin)){
  21. $row_cnt = mysqli_num_rows($result);
  22. if ($row_cnt > 0){
  23. while ($row = $result->fetch_array()){
  24. $uname = $row['username'];
  25. $uid = $row['userid'];
  26. $_SESSION['username'] = $uname;
  27. $_SESSION['userid'] = $uid;
  28. }
  29. header("refresh:1;url=index.php");
  30. echo 'You have successfully logged in ...<BR />Returning to index in a few seconds</CENTER>';
  31. } else {
  32. echo 'That was not a valid username or password!<BR /><BR />';
  33. echo 'Please try again <A HREF="index.php" CLASS="navlink">here</A></CENTER>';
  34. }
  35. }
  36. include_once ('footer.php');
  37. ?>