aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/functions
diff options
context:
space:
mode:
authorJames Atkinson <thefinn@users.sourceforge.net>2001-02-21 07:38:38 +0000
committerJames Atkinson <thefinn@users.sourceforge.net>2001-02-21 07:38:38 +0000
commit852573b1985b220638aa68df89faf086a7d62fc3 (patch)
tree311a1c5465e8d51c012226c5fe5c8d5a8ddb7bce /phpBB/functions
parent160aea48c43f2881143c3104cd17ff2c8e440675 (diff)
downloadforums-852573b1985b220638aa68df89faf086a7d62fc3.tar
forums-852573b1985b220638aa68df89faf086a7d62fc3.tar.gz
forums-852573b1985b220638aa68df89faf086a7d62fc3.tar.bz2
forums-852573b1985b220638aa68df89faf086a7d62fc3.tar.xz
forums-852573b1985b220638aa68df89faf086a7d62fc3.zip
Added more needed files. Error handling functions file and PHPLib templates lib
git-svn-id: file:///svn/phpbb/trunk@7 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/functions')
-rw-r--r--phpBB/functions/error.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/phpBB/functions/error.php b/phpBB/functions/error.php
new file mode 100644
index 0000000000..e4277883a2
--- /dev/null
+++ b/phpBB/functions/error.php
@@ -0,0 +1,54 @@
+<?php
+/***************************************************************************
+ * error.php
+ * -------------------
+ * begin : Saturday, Feb 13, 2001
+ * copyright : (C) 2001 The phpBB Group
+ * email : support@phpbb.com
+ *
+ * $Id$
+ *
+ *
+ ***************************************************************************/
+
+
+/***************************************************************************
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ *
+ ***************************************************************************/
+
+function error_die($db, $error_code = "", $error_msg = "")
+{
+ if(!$error_msg)
+ {
+ switch($error_code)
+ {
+ case SQL_CONNECT:
+ $db_error = $db->sql_error();
+ $error_msg = "Error: phpBB could not connect to the database. Reason: " . $db_error["message"];
+ break;
+ case BANNED:
+ $error_msg = "You have been banned from this forum.";
+ break;
+ case QUERY_ERROR:
+ $db_error = $db->sql_error();
+ $error_msg = "Error: phpBB could not query the database. Reason: " . $db_error["message"];
+ break;
+ case SESSION_CREATE:
+ $error_msg = "Error creating session. Could not log you in. Please go back and try again.";
+ break;
+ }
+ }
+
+ die($error_msg);
+}
+
+
+
+
+?>