mirror of
https://codeberg.org/ThisIsMiseryy/techstore
synced 2026-05-14 12:42:04 +00:00
Finalizzazione implementazione Docker
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
|
||||
+10
-9
@@ -1,16 +1,17 @@
|
||||
<?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
|
||||
// Creazione e gestione eccezioni connessione
|
||||
try{
|
||||
$conn = mysqli_connect($host, $username, $password, $database);
|
||||
|
||||
// Controllo connessione
|
||||
if ($conn->connect_error) {
|
||||
die("Connessione fallita: " . $conn->connect_error);
|
||||
}
|
||||
catch(Exception $e) {
|
||||
error_log("Errore connessione database: " . $e->getMessage());
|
||||
die("Errore di connessione al database. Riprova più tardi.");
|
||||
}
|
||||
|
||||
// Opzionale: impostare charset
|
||||
|
||||
+12
-9
@@ -1,12 +1,3 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login - TechStore</title>
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
session_start();
|
||||
include 'db_conf.php';
|
||||
@@ -46,7 +37,19 @@
|
||||
$error = 'Errore nel database.';
|
||||
}
|
||||
}
|
||||
|
||||
$conn->close();
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login - TechStore</title>
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<form action="" method="POST">
|
||||
<h2>Login</h2>
|
||||
<label for="email">Indirizzo e-mail:</label>
|
||||
|
||||
Reference in New Issue
Block a user