Browse code

smtp fix + tester

Jimako authored on 2026/07/10 14:03:10
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,70 @@
1
+<?php
2
+
3
+// Some DB functions 
4
+
5
+if(!function_exists("dbconnect")) { // just in case.  Some people seemed to be having an issue and this was the easiest fix.
6
+
7
+function dbconnect($dbhost, $dbuser, $dbpass, $dbname ) {
8
+	$mysql_access = mysql_connect($dbhost, $dbuser, $dbpass);
9
+	if(!$mysql_access) {
10
+		include(_BASEDIR."languages/en.php");
11
+		die(_FATALERROR." "._NOTCONNECTED);
12
+	}
13
+	mysql_select_db($dbname, $mysql_access);
14
+	mysql_query("SET SESSION sql_mode = 'MYSQL40'");
15
+	return $mysql_access;
16
+}
17
+
18
+
19
+function dbquery($query) {
20
+	global $debug, $headerSent, $dbconnect;
21
+	if($debug  && $headerSent) echo "<!-- $query -->\n";
22
+	$result = mysql_query($query, $dbconnect) or accessDenied( _FATALERROR.(isADMIN ? "Query: ".$query."<br />Error: (".mysql_errno( ).") ".mysql_error( ) : ""));
23
+	return $result;
24
+}
25
+
26
+function dbnumrows($query) {
27
+	global $debug, $dbconnect;
28
+	if ($query === false && mysql_errno( ) > 0 && $debug) {
29
+		echo "<!-- dbnumrows ".mysql_error( )." -->\n";
30
+	}
31
+	$query = mysql_num_rows($query);
32
+	return $query;
33
+}
34
+
35
+function dbassoc($query) {
36
+	global $debug, $dbconnect;
37
+	if ($query === false && mysql_errno( ) > 0 && $debug) {
38
+		echo "<!-- dbassoc ".mysql_error( )." -->\n";
39
+	}
40
+	$query = mysql_fetch_assoc($query);
41
+	return $query;
42
+}
43
+
44
+function dbinsertid($tablename = 0) {
45
+	return mysql_insert_id( );
46
+}
47
+
48
+function dbrow($query) {
49
+	global $debug, $dbconnect;
50
+	if ($query === false && mysql_errno( ) > 0 && $debug) {
51
+		if($error) echo "<!-- dbrow ".mysql_error( )." -->\n";
52
+	}
53
+	$query = mysql_fetch_row($query);
54
+	return $query;
55
+}
56
+
57
+// Used to escape text being put into the database.
58
+function escapestring($str) {
59
+   if (!is_array($str)) return mysql_real_escape_string($str);
60
+   else return array_map('escapestring', $str);
61
+}
62
+
63
+function dbclose( ) {
64
+	global $dbconnect;
65
+	mysql_close($dbconnect);
66
+
67
+}
68
+// End DB functions
69
+}
70
+?>
0 71
\ No newline at end of file