diff --git a/adminforce/frametest.php b/adminforce/frametest.php
index 7a6bafee8f3f6a6ed1fc82ca5b9e2549bd197f08..e24cf6615bf4da1da45e0802269a0b407b4f72c8 100644
--- a/adminforce/frametest.php
+++ b/adminforce/frametest.php
@@ -7,8 +7,8 @@ if ($_GET['testen'] == 'true') {
     if ($_GET['frame'] == 'true') {
         echo 'Dies ist der Testframe';
     } else {
-        @require_once ('../lib/functions.lib.php');
-        @db_connect();
+        require_once ( '../lib/datenbank.inc.php' );
+        require_once ( '../lib/functions.lib.php' );
         if (!isset($_GET['art'])) $_GET['art'] = "";
         if (!isset($forced['tan'])) $forced['tan'] = "";
         if (!isset($forced['ziel'])) $forced['ziel'] = "";
@@ -35,7 +35,6 @@ if ($_GET['testen'] == 'true') {
 </frameset><noframes></noframes><noframes>Bei dir sind keine Frames aktiviert!</noframes>
 </body>
 </html>';
-        db_close();
     }
 } else {
     echo 'Javascript Test! Bitte warte einen Moment!
@@ -44,4 +43,4 @@ if ($_GET['testen'] == 'true') {
     document.location = "frametest.php?url=' . $_GET['url'] . '&testen=true&tan=' . $_GET['tan'] . '";
     //-->
     </script>';
-}
\ No newline at end of file
+}
diff --git a/cron.php b/cron.php
index 1014c9ee0f2c4cdf2ec21a477e2f692b7bdfcda0..fe488aa8959b024de1be55d50f8b68a54be3c5b8 100644
--- a/cron.php
+++ b/cron.php
@@ -4,7 +4,7 @@
 
 require ( 'lib/datenbank.inc.php' );
 require ( 'lib/functions.lib.php' );
-db_connect();
+
 if ($_GET['pw'] != $cron_pw) die('Zugriff verweigert!');
 
 $cron = (int)$_GET['id'];
@@ -34,4 +34,3 @@ if ( include ($result['datei']) ){
 	echo 'Cron gelaufen';
 } else echo 'Cron nicht gelaufen';
 
-db_close();
\ No newline at end of file
diff --git a/crons/db_backup.php b/crons/db_backup.php
index e44f2508a64eb9741084438336b43d73a95c544e..21b4b095d682dac2d0968141bbc9efc3d1e48771 100644
--- a/crons/db_backup.php
+++ b/crons/db_backup.php
@@ -2,7 +2,7 @@
  
 require('../lib/datenbank.inc.php');
 require('../lib/functions.lib.php');
-db_connect();
+
 if($_GET['cron_pw'] == $cron_pw){
 	set_time_limit(0);
 
@@ -27,5 +27,4 @@ if($_GET['cron_pw'] == $cron_pw){
 	mysqli_close($sql_open);
 	die();
 }
-db_close();
-?>
\ No newline at end of file
+?>
diff --git a/index.php b/index.php
index 983d01d1a114392c5d24c334be95d663d258c7dd..7b29ad39386023f280104c4b63af10237fc479a0 100644
--- a/index.php
+++ b/index.php
@@ -14,7 +14,6 @@ if (!ini_get('display_errors')) {
 }
 
 require ('lib/datenbank.inc.php');
-db_connect();
 require ('lib/functions.lib.php');
 require ('lib/session.lib.php');
 require ('lib/run.inc.php');
@@ -202,6 +201,5 @@ $ts = strtotime($datetime);
     </body>
 </html>
 <?php
-db_close();
 if ($gzip_rate > 0) ob_end_flush();
 ?>
diff --git a/pcheck.php b/pcheck.php
index 499166032edb5b1c1b554b375bea3911b0d97073..b454f56274d377a69b34872bdc3efc61ba96bdfb 100644
--- a/pcheck.php
+++ b/pcheck.php
@@ -1,4 +1,5 @@
 <?php
+require ( 'lib/datenbank.inc.php' );
 require_once ('lib/functions.lib.php');
 
 //Variablen vordefinieren
@@ -10,9 +11,6 @@ if (!isset($_GET['auszahlen']))	       $_GET['auszahlen']	= "false";
 $_GET['uid'] = (int)$_GET['uid'];
 $_GET['tan'] = addslashes ($_GET['tan']);
 
-//DB Verbindung herstellen
-db_connect();
-
 $mail =  mysqli_fetch_assoc(db_query("SELECT e.start,e.aufendhalt,e.status,e.uid,v.verdienst FROM ".$db_prefix."_paidmails_empfaenger e
                                                                               LEFT JOIN ".$db_prefix."_paidmails_versendet v ON v.tan = e.tan
                                                                               WHERE e.tan='".$_GET['tan']."' AND e.uid=".$_GET['uid']." AND e.gueltig > ".time()." LIMIT 1"));
@@ -61,4 +59,3 @@ echo '
         </table>
     </body>
 </html>';
-db_close();
\ No newline at end of file
diff --git a/pclick.php b/pclick.php
index 5dfc5a3f0fb0bc7e74717583906395ff75295303..169f5b47f2e541228d7d753c2d22865d9061434c 100644
--- a/pclick.php
+++ b/pclick.php
@@ -1,6 +1,6 @@
 <?php
+require ( 'lib/datenbank.inc.php' );
 require_once ('lib/functions.lib.php');
-db_connect();
 
 $_GET['uid'] = (int)$_GET['uid'];
 $_GET['tan'] = addslashes ($_GET['tan']);
@@ -18,5 +18,3 @@ echo '
             <frame name="werbung" src="'.$mail['ziel'].'" scrolling="auto" frameborder="0">
         </frameset>
 </html>';
-
-db_close();
diff --git a/pl.php b/pl.php
index 910a2ed25ac41e029abd5be683e392433d398ded..055a06772251ae85877b38821e4315f82022ad15 100644
--- a/pl.php
+++ b/pl.php
@@ -1,6 +1,6 @@
-<?
+<?php
+require_once ( 'lib/datenbank.inc.php' );
 @require_once ('lib/functions.lib.php');
-@db_connect();
 @require_once ('lib/session.lib.php');
 if (!isset($_GET['art']))		$_GET['art']		= "";
 if (!isset($text['tan']))		$text['tan']		= "";
@@ -21,4 +21,3 @@ $text = mysqli_fetch_array(db_query("SELECT * FROM ".$db_prefix."_gebuchte_werbu
 </frameset>
 </body>
 </html>
-<?db_close();?>