Implementazione variabili d'ambiente database

This commit is contained in:
2026-04-15 11:26:39 +02:00
3 changed files with 10 additions and 5 deletions
+4 -4
View File
@@ -1,9 +1,9 @@
<?php
// Configurazione connessione database
$host = 'localhost';
$username = 'techstore';
$password = 'dioporco';
$database = 'TechStore';
$host = getenv("DB_HOST") ?: 'localhost';
$username = getenv("DB_USERNAME") ?:'techstore';
$password = getenv("DB_PASSWORD") ?: 'dioporco';
$database = getenv("DB_DATABASE") ?: 'TechStore';
// Creazione connessione
$conn = mysqli_connect($host, $username, $password, $database);