daily pastebin goal
66%
SHARE
TWEET

Untitled

a guest Jun 5th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function login ($action,$user = '',$pass = '') {
  2.         session_start();
  3.         if ($action == 'check') {
  4.             if($_SESSION['logged'] && ($_SESSION['key'] == 'AkerTech_'.md5($_SESSION['user']))) {
  5.                 return true;
  6.             } else {
  7.                 include('fLogin.php');
  8.                 die();
  9.               }
  10.         }
  11.         else if ($action == 'enter') {
  12.             $pass = md5($pass);
  13.             $row = consult("SELECT * FROM users WHERE user = '$user' AND password = '$pass'");
  14.             if ($row != 0) {
  15.                 $_SESSION['logged'] = true;
  16.                 $_SESSION['uid'] = $row[0]->id;
  17.                 $_SESSION['user'] = $row[0]->user;
  18.                 $_SESSION['key'] = 'AkerTech_'.md5($row[0]->user);
  19.                 return true;
  20.             } else {
  21.                 echo "<script>alert('error')</script>";
  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