-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb.php
More file actions
87 lines (73 loc) · 2.08 KB
/
db.php
File metadata and controls
87 lines (73 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/**
* DB
* @author Rene Faustino Gabriel Junior <renefgj@gmail.com> (Analista-Desenvolvedor)
* @copyright Copyright (c) 2014 - sisDOC.com.br
* @access public
* @version v0.14.17
* @package System
* @subpackage Database connection
*/
/* Noshow Errors */
$debug = 1;
date_default_timezone_set('Etc/GMT+2');
if (file_exists('debug.txt')) { $debug1 = 0; $debug2 = 255; }
ini_set('display_errors', $debug1);
ini_set('error_reporting', $debug2);
if (!isset($include)) { $include = '_include/'; }
else { $include .= '_include/'; }
if (!isset($include_db)) { $include_db = '_db/'; }
else { $include_db .= '_db/'; }
ob_start();
session_start();
/* Path Directory */
$path_info = trim($_SERVER['PATH_INFO']);
/* Set header param */
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
$ip = $_SERVER['SERVER_ADDR'];
if ($ip == '::1') { $ip = '127.0.0.1'; }
$charset = 'utf-8';
header('Content-Type: text/html; charset='.$charset);
/* Include */
require($include.'sisdoc_sql.php');
require($include.'sisdoc_debug.php');
require($include.'_class_msg.php');
require($include.'_class_char.php');
global $cnn,$conn;
//echo '<br><br>'.$cnn;
//echo '<br><br>'.$conn;
/* Leituras das Variaveis dd0 a dd99 (POST/GET) */
$vars = array_merge($_GET, $_POST);
$acao = troca($vars['acao'],"'",'´');
for ($k=0;$k < 100;$k++)
{
$varf='dd'.$k;
$varf=$vars[$varf];
$dd[$k] = post_security($varf);
}
/* Data base */
$filename = $include_db."db_mysql_".$ip.".php";
if (!(file_exists($filename))) { $filename = '../'.$include_db."db_mysql_".$ip.".php"; }
if (file_exists($filename))
{
require($filename);
} else {
if ($install != 1)
{
echo $filename.' not found';
exit;
redireciona('__install/index.php');
}
}
function post_security($s)
{
$s = troca($s,'<','<');
$s = troca($s,'>','>');
$s = troca($s,'"','"');
//$s = troca($s,'/',''');
$s = troca($s,"'",'/');
return($s);
}
?>