Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. <?php
  2. $test = penis1;
  3. session_start();
  4. include './php/Config/Cfg_Master.php';
  5. if (isset($_POST['submit'])) {
  6. $username = $_POST['uid'];
  7. $password = $_POST['password'];
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15. chckusername($username, $password);
  16. }
  17.  
  18. function chckusername($username, $password){
  19. include_once 'php/Config/Cfg_Master.php';
  20. $check = "SELECT * FROM players WHERE uid='$username' ";
  21. $check_q = mysqli_query($check,$db_game) or die("<div class='loginmsg'>Uid ist falsch<div>");
  22.  
  23. if (mysqli_num_rows($check_q) == 1) {
  24. chcklogin($username, $password);
  25. }
  26. else{
  27. echo "<div id='loginmsg'>Uid ist falsch</div>";
  28. }
  29. }
  30.  
  31. function chcklogin($username, $password){
  32. include_once 'php/Config/Cfg_Master.php';
  33. $login = "SELECT * FROM players WHERE uid='$username' and password='$password'";
  34. $login_q = mysqli_query($login,$db_game) or die('Falsches Passwort');
  35.  
  36. if (mysqli_num_rows($login_q)){
  37. $usr = mysqli_fetch_array($login_q, MYSQLI_BOTH);
  38. $_SESSION['uid'] = $username;
  39. $_SESSION['name'] = $usr['name'];
  40. $_SESSION['coplevel'] = $usr['coplevel'];
  41. $_SESSION['mediclevel'] = $usr['mediclevel'];
  42. $_SESSION['adminlevel'] = $usr['adminlevel'];
  43. $_SESSION['pid'] = $usr['pid'];
  44. $_SESSION['melden']= $usr['melden'];
  45. if ($_SESSION['uid'] = $username){
  46. header('Location: start.php');}
  47. if ($_SESSION['coplevel'] >=9){
  48. header('Location: ./intern/cop/start.php');
  49. }
  50. if ($_SESSION['mediclevel'] > 9){
  51. header('Location:./intern/med/start.php');}
  52. if ($_SESSION['coplevel'] && $_SESSION['mediclevel']>= 9 )
  53. {
  54. header('Location:./intern/pp/start.php');}
  55. }
  56.  
  57. else {
  58. echo "<div id='loginmsg'>alsches Passwort </div>";
  59. //header('Location: login-problem.php');
  60. }
  61. }
  62.  
  63.  
  64. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement