-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconexion.php
43 lines (35 loc) · 1.11 KB
/
conexion.php
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
<?php
/*
* Filename: conexion.php
* Description: create forms and SQL statements automatically
* @author Hector Mantellini (@xombra) - http://xombra.com
* @contributor Angel Cruz (@abr4xas) - http://abr4xas.org
* vie 31 jul 2015 02:00:05 VET
* License: GPLv2 or later
* @version 0.1
*/
// limpieza
function elimina_slash($valor) {
if (get_magic_quotes_gpc()) {
$valor= stripslashes($valor); }
return $valor;
}
function filter($string) {
$replace = "%20";
$search = array(">", "<", "|", ";", "-","'","&");
$result = str_replace($search, $replace, $string);
return $result;
}
// fin limpieza
$matriz_ini = parse_ini_file("config.ini");
$indice = 0;
while (list($key, $val) = each($matriz_ini)) {
$parametro[$indice] = $val;
$indice++;
}
$conexion = @mysql_connect($parametro[0],$parametro[1], $parametro[2])
or die("Error en conexión a Servidor de Base de datos");
@mysql_select_db($parametro[3], $conexion)
or die("Error en conexión a Base de datos");
$_SERVER["QUERY_STRING"] = filter(elimina_slash(trim(html_entity_decode($_SERVER["QUERY_STRING"],ENT_QUOTES))));
?>