Advertisement
Guest User

Untitled

a guest
Mar 15th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. <?php
  2. require("../api/mysql.php");
  3. session_start();
  4.  
  5. if (login($_POST["username"], $_POST["password"])) {
  6. $_SESSION["username"] = $_POST["username"];
  7. }else{
  8. echo "ERROR";
  9. return;
  10. }
  11.  
  12. header("Location: ../index.php");
  13.  
  14. ?>
  15.  
  16.  
  17. function login($username, $password) {
  18. return get_mysql()->query("SELECT count(*) FROM WebinterfaceUsers WHERE USERNAME = '$username' and PASSWORD = '$password'")->fetch_assoc()["count(*)"] > 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement