|
|
@@ -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);
|
|
|
}
|