Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <?php
  2. echo "<h1>Welcome back, loyal community member.</h1>";
  3. $dbconnect = new mysqli("localhost", "benjamin", "TheBestPassword99!", "database0");
  4.  
  5. if ($dbconnect->connect_error)
  6. {
  7. die("ERROR: Unable to connect: ".$dbconnect->connect_error);
  8. }
  9.  
  10. #$logincust = $dbconnect->real_escape_string($_POST[loginCustomer]); #The real_escape_string ensures that the input cannot use
  11. #$loginpass = $dbconnect->real_escape_string($_POST[loginPassword]); # SQL injection in this particular input.
  12. $logincust = $dbconnect->$_POST[loginCustomer]; #The real_escape_string ensures that the input cannot use
  13. $loginpass = $dbconnect->$_POST[loginPassword];
  14. $hashcheck = password_hash($loginpass,MD5);
  15. $sql = $dbconnect->query("SELECT * FROM records0 WHERE CustomerName = '$logincust' AND Password = '$hashcheck'");
  16. $row = $sql->fetch_assoc();
  17. if (!$row)
  18. {
  19. echo "<body style='background-color:powderblue'>";
  20. exit("I'm afraid that wasn't quite right, please try again". $dbconnect->error);
  21. }
  22. {
  23. echo "<body style='background-color:powderblue'>";
  24. echo "Welcome, ". $row["CustomerName"]." ,Your location has been noted, a team is on their way to you";
  25. }
  26. #terminate connection
  27. $dbconnect->close();
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement