andre 4 년 전
부모
커밋
4f649f9ae9
1개의 변경된 파일2개의 추가작업 그리고 31개의 파일을 삭제
  1. 2 31
      index.php

+ 2 - 31
index.php

@@ -1,42 +1,13 @@
 <?php
-
-class db {
-    private $host   = 'localhost';  //Host
-    private $user   = 'ban';        //Username
-    private $pw     = 'Blubb123';   //DBpasswort
-    private $dbname = 'ban';        //Datenbankname
-
-    static public $db_obj = null;
-
-    function __construct(){
-        try
-        {
-            self::$db_obj = new mysqli($this->host, $this->user, $this->pw, $this->dbname);
-            self::$db_obj->set_charset('utf8');
-        }
-        catch(Exception $e)
-        {
-            printf('Fehler beim &Ouml;ffnen der Datenbank.<br><br>%s',
-            $e->getMessage);
-            exit();
-        }
-    }
-    public static function getInstance(){
-        if(self::$db_obj === null)
-        self::$objekt = new db_sql;
-        return self::$db_obj;
-    }
-    private final function __clone(){ }
-}
-
 error_reporting(E_ALL);
 $ip = trim($_GET['ip']);
 $token = trim($_GET['token']);
 $action = trim($_GET['action']);
-$db = new db;
+$db = new mysqli('localhost', 'ban', 'Blubb123-', 'ban');
 if ($db->connect_errno){
     die($db->connect_error);
 }
+$db->set_charset('utf8');
 
 function checkToken($token,$db) {
     $dbAction = $db->prepare("SELECT description FROM clients WHERE token = ?");