mirror of
https://codeberg.org/ThisIsMiseryy/techstore
synced 2026-05-14 14:52:04 +00:00
Implementazione variabili d'ambiente database
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
DB_HOST=localhost
|
||||
DB_USERNAME=techstore
|
||||
DB_PASSWORD=dioporco
|
||||
DB_DATABASE=TechStore
|
||||
@@ -1,3 +1,4 @@
|
||||
src/img/*
|
||||
!src/img/example/
|
||||
!src/img/logo.png
|
||||
.env
|
||||
+4
-4
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user