tupali_fork/milfs/funciones/conex.php

66 lines
1.5 KiB
PHP
Raw Normal View History

2016-10-29 15:07:15 +00:00
<?php
function Conectarse(){
if ( !isset ( $link ) ) {
@include("includes/datos.php");
if(!isset($db)) {
2017-03-08 02:36:47 +00:00
@include("milfs/includes/datos.php");
if(!isset($db)) {
include("../milfs/includes/datos.php");
2016-10-29 15:07:15 +00:00
}
2017-03-08 02:36:47 +00:00
}
2016-10-29 15:07:15 +00:00
if (!($link=mysqli_connect($servidor,$usuario,$password,$db)))
{
2017-03-08 02:36:47 +00:00
echo "Error conectando a la base de datos. ";
2016-10-29 15:07:15 +00:00
exit();
}
2016-11-26 06:35:47 +00:00
/* if (!mysqli_select_db($db,$link))
2016-10-29 15:07:15 +00:00
{
echo "Error seleccionando la base de datos.";
exit();
}
*/
$_SESSION['path']= $path_instalacion;
$_SESSION['path_images_secure']= $path_images_secure;
$_SESSION['url']= $url;
$_SESSION['site']= $site;
$_SESSION['analizador']= "$codigo_analizador";
$_SESSION['upload_size']= $upload_size;
return $link;
}
}
2017-03-08 02:36:47 +00:00
function Conectarse_recursivo(){
if ( !isset ( $link ) ) {
@include("milfs/includes/datos.php");
if(!isset($db)) {
@include("../milfs/includes/datos.php");
if(!isset($db)) {
include("../includes/datos.php");
}
2017-03-08 02:36:47 +00:00
}
2016-10-29 15:07:15 +00:00
2017-03-08 02:36:47 +00:00
if (!($link=mysqli_connect($servidor,$usuario,$password,$db)))
{
echo "Error conectando a la base de datos. $servidor,$usuario,$password,$db ";
2017-03-08 02:36:47 +00:00
exit();
}
/* if (!mysqli_select_db($db,$link))
{
echo "Error seleccionando la base de datos.";
exit();
}
*/
$_SESSION['path']= $path_instalacion;
$_SESSION['path_images_secure']= $path_images_secure;
$_SESSION['url']= $url;
$_SESSION['site']= $site;
$_SESSION['analizador']= "$codigo_analizador";
$_SESSION['upload_size']= $upload_size;
return $link;
}
}
2016-10-29 15:07:15 +00:00
?>