removed bck files and imporved passowrd on env

This commit is contained in:
2026-05-14 12:06:24 +02:00
parent 3ed4a1b682
commit 403f74778d
72 changed files with 887 additions and 14858 deletions
+41 -8
View File
@@ -1,8 +1,41 @@
<?php
$con = mysqli_connect('localhost', 'u00wiumd4xnrd', 'ukowysga7w5x', 'dbcov4clvrmrzn');
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?>
<?php
/*
|--------------------------------------------------------------------------
| Load Composer and .env
|--------------------------------------------------------------------------
| This file is inside: cmccopiaoriginale/public/
| vendor and .env are inside: cmccopiaoriginale/
*/
require_once __DIR__ . '/../vendor/autoload.php';
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/../');
$dotenv->safeLoad();
/*
|--------------------------------------------------------------------------
| Database configuration from .env
|--------------------------------------------------------------------------
*/
$host = $_ENV['DB_HOST'] ?? getenv('DB_HOST') ?? 'localhost';
$username = $_ENV['DB_USERNAME'] ?? getenv('DB_USERNAME') ?? '';
$password = $_ENV['DB_PASSWORD'] ?? getenv('DB_PASSWORD') ?? '';
$database = $_ENV['DB_DATABASE'] ?? getenv('DB_DATABASE') ?? '';
/*
|--------------------------------------------------------------------------
| MySQLi connection
|--------------------------------------------------------------------------
*/
$con = mysqli_connect($host, $username, $password, $database);
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
exit;
}
mysqli_set_charset($con, "utf8mb4");