Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require("../api/mysql.php");
- session_start();
- if (login($_POST["username"], $_POST["password"])) {
- $_SESSION["username"] = $_POST["username"];
- }else{
- echo "ERROR";
- return;
- }
- header("Location: ../index.php");
- ?>
- function login($username, $password) {
- return get_mysql()->query("SELECT count(*) FROM WebinterfaceUsers WHERE USERNAME = '$username' and PASSWORD = '$password'")->fetch_assoc()["count(*)"] > 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement