[232] | 1 | <?php
|
---|
| 2 | /***************************************************************************
|
---|
| 3 | * db.php
|
---|
| 4 | * -------------------
|
---|
| 5 | * begin : Saturday, Feb 13, 2001
|
---|
| 6 | * copyright : (C) 2001 The phpBB Group
|
---|
| 7 | * email : support@phpbb.com
|
---|
| 8 | *
|
---|
| 9 | * Id: db.php,v 1.10 2002/03/18 13:35:22 psotfx Exp
|
---|
| 10 | *
|
---|
| 11 | *
|
---|
| 12 | ***************************************************************************/
|
---|
| 13 |
|
---|
| 14 | /***************************************************************************
|
---|
| 15 | * This file is part of the phpBB2 port to Nuke 6.0 (c) copyright 2002
|
---|
| 16 | * by Tom Nitzschner (tom@toms-home.com)
|
---|
| 17 | * http://bbtonuke.sourceforge.net (or http://www.toms-home.com)
|
---|
| 18 | *
|
---|
| 19 | * As always, make a backup before messing with anything. All code
|
---|
| 20 | * release by me is considered sample code only. It may be fully
|
---|
| 21 | * functual, but you use it at your own risk, if you break it,
|
---|
| 22 | * you get to fix it too. No waranty is given or implied.
|
---|
| 23 | *
|
---|
| 24 | * Please post all questions/request about this port on http://bbtonuke.sourceforge.net first,
|
---|
| 25 | * then on my site. All original header code and copyright messages will be maintained
|
---|
| 26 | * to give credit where credit is due. If you modify this, the only requirement is
|
---|
| 27 | * that you also maintain all original copyright messages. All my work is released
|
---|
| 28 | * under the GNU GENERAL PUBLIC LICENSE. Please see the README for more information.
|
---|
| 29 | *
|
---|
| 30 | ***************************************************************************/
|
---|
| 31 |
|
---|
| 32 | /***************************************************************************
|
---|
| 33 | *
|
---|
| 34 | * This program is free software; you can redistribute it and/or modify
|
---|
| 35 | * it under the terms of the GNU General Public License as published by
|
---|
| 36 | * the Free Software Foundation; either version 2 of the License, or
|
---|
| 37 | * (at your option) any later version.
|
---|
| 38 | *
|
---|
| 39 | ***************************************************************************/
|
---|
| 40 | /*
|
---|
| 41 | if (stristr($_SERVER['PHP_SELF'], "db.php")) {
|
---|
| 42 | Header("Location: index.php");
|
---|
| 43 | die();
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | if (!defined('MODULE_FILE')) {
|
---|
| 47 | die ("Non puoi accedere al file direttamente...");
|
---|
| 48 | }
|
---|
| 49 | */
|
---|
| 50 |
|
---|
| 51 | $the_include = "class/db"; // directory dove ci sono le classi
|
---|
| 52 |
|
---|
| 53 | switch($dbtype) {
|
---|
| 54 |
|
---|
| 55 | case 'MySQL':
|
---|
| 56 | include("".$the_include."/mysql.php");
|
---|
| 57 | break;
|
---|
| 58 |
|
---|
| 59 | case 'mysql4':
|
---|
| 60 | include("".$the_include."/mysql4.php");
|
---|
| 61 | break;
|
---|
| 62 |
|
---|
| 63 | case 'sqlite':
|
---|
| 64 | include("".$the_include."/sqlite.php");
|
---|
| 65 | break;
|
---|
| 66 |
|
---|
| 67 | case 'postgres':
|
---|
| 68 | include("".$the_include."/postgres7.php");
|
---|
| 69 | break;
|
---|
| 70 |
|
---|
| 71 | case 'mssql':
|
---|
| 72 | include("".$the_include."/mssql.php");
|
---|
| 73 | break;
|
---|
| 74 |
|
---|
| 75 | case 'oracle':
|
---|
| 76 | include("".$the_include."/oracle.php");
|
---|
| 77 | break;
|
---|
| 78 |
|
---|
| 79 | case 'msaccess':
|
---|
| 80 | include("".$the_include."/msaccess.php");
|
---|
| 81 | break;
|
---|
| 82 |
|
---|
| 83 | case 'mssql-odbc':
|
---|
| 84 | include("".$the_include."/mssql-odbc.php");
|
---|
| 85 | break;
|
---|
| 86 |
|
---|
| 87 | case 'db2':
|
---|
| 88 | include("".$the_include."/db2.php");
|
---|
| 89 | break;
|
---|
| 90 |
|
---|
| 91 | }
|
---|
| 92 |
|
---|
| 93 | $db = new sql_db($dbhost, $dbuname, $dbpass, $dbname, false);
|
---|
| 94 | if(!$db->db_connect_id) {
|
---|
| 95 | die("<br><br><center><img src=images/logo.gif><br><br><b>There seems to be a problem with the $dbtype server, sorry for the inconvenience.<br><br>We should be back shortly.</center></b>");
|
---|
| 96 | }
|
---|
| 97 |
|
---|
| 98 | ?>
|
---|