Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('connection.php');
- session_start();
- if(isset($_POST['username']) && isset($_POST['password'])){
- $username = $_POST['username'];
- $password = $_POST['password'];
- $query = $con->prepare("SELECT username, password FROM member WHERE username = '".$username."' && password = '".$password."'");
- $query->execute();
- while ($row = $query->fetch(PDO::FETCH_ASSOC)){
- if($username != $row['username']){
- echo "Username is not exist";
- }
- if($password != $row['password']){
- echo "Password is not valid";
- }
- if($password == $row['username'] && $username == $row['password']){
- $_SESSION['username'] = $username;
- $_SESSION['password'] = $password;
- header('location: index.php');
- }
- }
- }
- ?>
Add Comment
Please, Sign In to add comment