1
0

ajout fermeture de la database

This commit is contained in:
2022-09-19 12:04:33 +02:00
parent cf526f166c
commit cd91a95aea
5 changed files with 18 additions and 5 deletions

View File

@ -10,8 +10,10 @@ require_once 'fonctions.inc.php';
// $level => INFO, ALERT, ERROR
function log_write($log, $level=INFO)
{
global $table_prefix, $webmaster, $db;
global $table_prefix, $webmaster;
// actual connected user or user 'script'
$db = new db();
$user = (!empty( $_SERVER["PHP_AUTH_USER"])?$_SERVER["PHP_AUTH_USER"]:'Intruder?!');
//mail message
@ -54,6 +56,7 @@ function log_write($log, $level=INFO)
{
mail( $webmaster, "Erreur Site Web", $log_mail );
}
$db->close();
}
// $w_db = true -> write log in database (default)