andre преди 4 години
родител
ревизия
59386822e5
променени са 1 файла, в които са добавени 14 реда и са изтрити 1 реда
  1. 14 1
      index.php

+ 14 - 1
index.php

@@ -1,9 +1,22 @@
 <?php
 error_reporting(E_ALL);
+class db extends mysqli {
+    protected $host = 'localhost';
+    protected $user = 'ban';
+    protected $pass = 'Blubb123-';
+    protected $db   = 'ban';
+
+    public function __construct() {
+        @parent::__construct($this->$host, $this->$user, $this->$pass, $this->$db);
+        if($this->connect_errno){
+            die($db->connect_error);
+        }
+    }
+}
 $ip = trim($_GET['ip']);
 $token = trim($_GET['token']);
 $action = trim($_GET['action']);
-$db = new mysqli('localhost', 'ban', 'Blubb123-', 'ban');
+$db = new db();
 if ($db->connect_errno){
     die($db->connect_error);
 }