daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Jun 8th, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5.  
  6. <?php
  7. $servername = "localhost";
  8. $username = "root";
  9. $password = "";
  10. $dbname = "LoginDB";
  11. $fName = $_POST["fName"];
  12. $fPsw = $_POST["fPsw"];
  13. // Create connection
  14. $conn = new mysqli($servername, $username, $password, $dbname);
  15. // Check connection
  16. if ($conn->connect_error) {
  17.      die("Connection failed: " . $conn->connect_error);
  18. }
  19.  
  20. $sql = "SELECT * FROM `data` WHERE Name =".$fName."LIMIT 1";
  21.  
  22. $result = $conn->query($sql);
  23. $row = $result->fetch_assoc();
  24.  
  25. if ($result->num_rows > 0 && $row["Password"] == $fPsw) {
  26.     echo "Hello ".$row["Role"]." ". $row["Name"];
  27. } else {
  28.      echo "0 results";
  29. }
  30.  
  31. $conn->close();
  32. ?>
  33.  
  34. </body>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top