ThLoser

Untitled

Mar 20th, 2014
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?php
  2.     if (isset($_POST['login'])) {
  3.         $username = $sqli->real_escape_string($_POST['username']);
  4.         $password = $sqli->real_escape_string($_POST['password']);
  5.         $usrCheck = $sqli->query("SELECT * FROM användartabell WHERE username='".$username."' LIMIT 1")->num_rows;
  6.         $pwdCheck = $sqli->query("SELECT * FROM användartabell WHERE password='".$password."' LIMIT 1")->num_rows;
  7.         if ($usrCheck != 0 && $pwdCheck != 0) {
  8.             $_SESSION['sess_logg'] = 1; // Gör så att hemsidan vid senare tillfälle vet att man är inloggad
  9.         }
  10.         header("Location: index.php");
  11.         exit;
  12.     }
  13. ?>
Advertisement
Add Comment
Please, Sign In to add comment