Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $error = "";
- if(isset($_POST['submit'])) {
- $query = mysqli_query($this->db,"SELECT * FROM users
- WHERE username = '".$_POST['username']."' AND password = '".$_POST['password']."'");
- if(mysqli_num_rows($query) == 0) {
- $error = "Username or Passowrd is incorrect.";
- } else {
- $fetch = mysqli_fetch_array($query);
- $_SESSION['user'] = $fetch['id'];
- $error = "You are now logged in.";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement