mirror of
https://codeberg.org/ThisIsMiseryy/techstore
synced 2026-05-14 12:42:04 +00:00
Aggiunta supporto variabili d'ambiente per parametri connessione DB
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
DB_HOST=localhost
|
||||||
|
DB_USERNAME=techstore
|
||||||
|
DB_PASSWORD=dioporco
|
||||||
|
DB_DATABASE=TechStore
|
||||||
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
img/*
|
img/*
|
||||||
!img/example/
|
!img/example/
|
||||||
!img/logo.png
|
!img/logo.png
|
||||||
|
.env
|
||||||
+4
-4
@@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
// Configurazione connessione database
|
// Configurazione connessione database
|
||||||
$host = 'localhost';
|
$host = getenv("DB_HOST") ?: 'localhost';
|
||||||
$username = 'techstore';
|
$username = getenv("DB_USERNAME") ?:'root';
|
||||||
$password = 'dioporco';
|
$password = getenv("DB_PASSWORD") ?: '';
|
||||||
$database = 'TechStore';
|
$database = getenv("DB_DATABASE") ?: 'TechStore';
|
||||||
|
|
||||||
// Creazione connessione
|
// Creazione connessione
|
||||||
$conn = mysqli_connect($host, $username, $password, $database);
|
$conn = mysqli_connect($host, $username, $password, $database);
|
||||||
|
|||||||
Reference in New Issue
Block a user