daily pastebin goal
58%
SHARE
TWEET

Untitled

whitestarrr Dec 6th, 2016 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     session_start();
  3.     include_once("connect.php");
  4.  
  5.     $logged = false;
  6.     $log_id = "";
  7.     $log_username = "";
  8.     $log_password = "";
  9.  
  10.     if(isset($_SESSION["userid"]) && isset($_SESSION["username"]) && isset($_SESSION["password"])) {
  11.         $log_id = preg_replace('#[^0-9]#', '', $_SESSION['userid']);
  12.         $log_username = preg_replace('#[^a-z0-9]#i', '', $_SESSION['username']);
  13.         $log_password = $_SESSION['password'];
  14.         $username = $_SESSION ['username'];
  15.  
  16.         $sql = "SELECT * FROM users WHERE nickname='$username'";
  17.         $log_clan = mysqli_query($connect, $sql)->fetch_assoc()['clan'];
  18.  
  19.         $sql = "SELECT id FROM users WHERE id='$log_id' AND nickname='$log_username' AND password='$log_password' LIMIT 1";
  20.         $query = mysqli_query($connect, $sql);
  21.         $numrows = mysqli_num_rows($query);
  22.         if($numrows > 0){
  23.             $logged = true;
  24.         }
  25.     }
  26. ?>
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