daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Mar 17th, 2018 110 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. require_once('connection.php');
  3.  
  4. session_start();
  5. if(isset($_POST['username']) && isset($_POST['password'])){
  6.     $username = $_POST['username'];
  7.     $password = $_POST['password'];
  8.     $query = $con->prepare("SELECT username, password FROM member WHERE username = '".$username."' && password = '".$password."'");
  9.     $query->execute();
  10.     while ($row = $query->fetch(PDO::FETCH_ASSOC)){
  11.         if($username != $row['username']){
  12.             echo "Username is not exist";
  13.         }
  14.         if($password != $row['password']){
  15.             echo "Password is not valid";
  16.         }
  17.         if($password == $row['username'] && $username == $row['password']){
  18.             $_SESSION['username'] = $username;
  19.             $_SESSION['password'] = $password;
  20.             header('location: index.php');
  21.         }
  22.     }
  23. }
  24. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top