Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require_once 'conn.php';
- if(ISSET($_POST['login'])){
- $username = $_POST['username'];
- $password = $_POST['password'];
- $query = "SELECT COUNT(*) as count FROM `member` WHERE `username` = :username AND `password` = :password";
- $stmt = $conn->prepare($query);
- $stmt->bindParam(':username', $username);
- $stmt->bindParam(':password', $password);
- $stmt->execute();
- $row = $stmt->fetch();
- $count = $row['count'];
- if($count > 0){
- header('location:home.php');
- }else{
- $_SESSION['error'] = "Invalid username or password";
- header('location:login.php');
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement