SHARE
TWEET

Untitled

a guest Jun 17th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. require 'con_db.php';
  4.  
  5. $username = $_POST['admin'];
  6. $password = md5($_POST['password']);
  7.  
  8. $sql = $conn->query("SELECT * FROM login WHERE user = '$username' and password='$password'");
  9. $query = $sql->num_rows;
  10.  
  11.  
  12. if($query > 0) {
  13.     session_start();
  14.     $_SESSION['username'] = $username;
  15.     $_SESSION['status'] = "login";
  16.  
  17.         header('location:admin.php');
  18.  
  19. }
  20. else {
  21.  
  22.         echo "failed";
  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