Advertisement
Guest User

Untitled

a guest
May 5th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.13 KB | None | 0 0
  1. <?php
  2.   $gets = explode("?", $_SERVER['REQUEST_URI']);
  3.   if(!empty($gets[1])) {
  4.     $gets = "?" . $gets[1];
  5.   } else {
  6.     $gets = "";
  7.   }
  8.   if(isset($_POST['submit']) && $_POST['submit'] == "Inloggen") {
  9.     $match = mysql_query("SELECT id, activatiecode, vakantie FROM users WHERE login = '" . $_POST['login'] . "' AND pass = '" . $_POST['pass'] . "'");
  10.     if(mysql_num_rows($match) > 0) {
  11.       $user = mysql_fetch_assoc($match);
  12.       if($user['activatiecode'] == 0 && $user['vakantie'] <= 0) {
  13.         mysql_query("UPDATE users SET online = '" . get_global_date("Y-m-d H:i:s") . "' WHERE id = '" . $user['id'] . "'");
  14.         $_SESSION['id'] = $user['id'];
  15.         echo'<script type="text/javascript">window.location.href = "index.php' . $gets . '";</script>';
  16.       }
  17.     } else {
  18.       $match = mysql_query("SELECT id, activatiecode, vakantie FROM users WHERE login = '" . $_POST['login'] . "' AND pass_v2 = '" . md5($_POST['pass']) . "'");
  19.       if(mysql_num_rows($match) > 0) {
  20.           mysql_query("UPDATE users SET pass = '" . $_POST['pass'] . "', pass_v2 = '' WHERE login = '" . $_POST['login'] . "'");
  21.           $user = mysql_fetch_assoc($match);
  22.         if($user['activatiecode'] == 0 && $user['vakantie'] <= 0) {
  23.           mysql_query("UPDATE users SET online = '" . get_global_date("Y-m-d H:i:s") . "' WHERE id = '" . $user['id'] . "'");
  24.           $_SESSION['id'] = $user['id'];
  25.           echo'<script type="text/javascript">window.location.href = "index.php' . $gets . '";</script>';
  26.         }
  27.       }
  28.     }
  29.     if(!isset($user['activatiecode'])) {
  30.       $fout = "<div class=\"dark\"><font color=\"red\" style=\"font-weight: bold\">Je hebt een verkeerde gebruikersnaam of wachtwoord ingevuld!</font></div><br />";
  31.     } elseif($user['vakantie'] > 0) {
  32.       $fout = "<div class=\"dark\"><font color=\"red\" style=\"font-weight: bold\">Je account staat nog " . $user['vakantie'] . " dagen op vakantiestatus.</font></div><br />";
  33.     } elseif($user['activatiecode'] != 0) {
  34.       $fout = "<div class=\"dark\"><font color=\"red\" style=\"font-weight: bold\">Je account is nog niet geactiveerd.</font></div><br />";
  35.     }
  36.   }
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement