Guest User

Untitled

a guest
Oct 15th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1. Warning: mysqli_query() expects parameter 1 to be mysqli, null given in
  2. /home1/j8f5w8o7/nepe.smeext-carding.com/pieces/inc.php on line 26
  3.  
  4. Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in
  5. /home1/j8f5w8o7/nepe.smeext-carding.com/pieces/inc.php on line 27
  6.  
  7. <?php
  8. session_start();
  9. ob_start();
  10.  
  11. $display = new display();
  12. $user = new user();
  13.  
  14. DEFINE("localhost", "");
  15. DEFINE("j8f5w8o7_finix", "");
  16. DEFINE("yael2204", "");
  17. DEFINE("j8f5w8o7_finix", "");
  18.  
  19. $sql = new mysqli(host, username, password, database);
  20.  
  21. function __destruct()
  22. {
  23. ob_clean();
  24. }
  25.  
  26. class settings
  27. {
  28. public static function website($data)
  29. {
  30. global $sql;
  31.  
  32. $website = mysqli_query($sql, 'SELECT * FROM merchant LIMIT 1');
  33. $fwebsite = mysqli_fetch_array($website);
  34.  
  35. return $fwebsite[$data];
  36. }
  37. }
  38.  
  39. class display {
  40. public static function success($msg)
  41. {
  42. echo('<div class="alert alert-success role="alert" style="text-align: center;">'.$msg.'</div>');
  43. }
  44. public static function error($msg)
  45. {
  46. echo('<div class="alert alert-danger role="alert" style="text-align: center;">'.$msg.'</div>');
  47. }
  48. }
  49.  
  50. class user {
  51. function IsLogged()
  52. {
  53. global $sql;
  54.  
  55. /* If session exists. */
  56.  
  57. if(!isset($_SESSION['auth'])){
  58. header('Location: signin.php');
  59. exit();
  60. }
  61.  
  62. /* Additional check.If session is null or user does not exists. */
  63.  
  64. if(isset($_SESSION['auth'])) {
  65. if(is_numeric($_SESSION['auth']) && !empty($_SESSION['auth'])) {
  66. $query = mysqli_query($sql, 'SELECT UserName FROM users WHERE UserID = "'.$_SESSION['auth'].'"');
  67.  
  68. if(mysqli_num_rows($query) == 0) {
  69. unset($_SESSION['auth']);
  70. header('Location: signin.php');
  71. exit();
  72. }
  73. }
  74. }
  75. }
  76.  
  77. function IsBanned()
  78. {
  79. $banned = $this->GetData('UserBanned');
  80.  
  81. if($banned == 1) {
  82. header('Location: ./index.php');
  83. exit();
  84. }
  85. }
  86.  
  87. function IsAdmin()
  88. {
  89. if($this->GetData('UserAdmin') == 0) {
  90. header('Location: ./index.php');
  91. exit();
  92. }
  93. }
  94.  
  95. function HasMembership()
  96. {
  97. if($this->GetData('UserMembership') == 0) {
  98. header('Location: ./purchase.php');
  99. exit();
  100. }
  101. }
  102.  
  103. function GetData($data)
  104. {
  105. global $sql;
  106.  
  107. if(isset($_SESSION['auth'])) {
  108. $id = $_SESSION['auth'];
  109.  
  110. if(is_numeric($id)) {
  111. $query = mysqli_query($sql, 'SELECT '.$data.' FROM users WHERE UserID = "'.$id.'"');
  112. $row = mysqli_fetch_array($query);
  113. return $row[$data];
  114. }
  115. }
  116. }
  117. }
  118.  
  119. DEFINE("HOST", "localhost");
  120. DEFINE("USERNAME", "j8f5w8o7_finix");
  121. DEFINE("PASSWORD", "yael2204");
  122. DEFINE("DATABASE", "j8f5w8o7_finix");
  123.  
  124. $mysqli = new mysqli(HOST, USERNAME, PASSWORD, DATABASE);
  125.  
  126. $host="localhost";
  127. $username="j8f5w8o7_finix";
  128. $password="yael2204";
  129. $database="j8f5w8o7_finix";
  130. $mysqli = new mysqli($host, $username, $password, $database);
Add Comment
Please, Sign In to add comment